mit-han-lab / temporal-shift-module

[ICCV 2019] TSM: Temporal Shift Module for Efficient Video Understanding
https://arxiv.org/abs/1811.08383
MIT License
2.07k stars 417 forks source link

where can I find the 'kinetics_val.csv', 'kinetics_train.csv' #136

Open icyzhang0923 opened 4 years ago

icyzhang0923 commented 4 years ago

When I want to train the TSM model on kinetics, I do not find the file 'kinetics_val.csv', 'kinetics_train.csv'

fuqichen1998 commented 1 year ago

Have you solved this issue?

shukurullo2004 commented 2 months ago

you should create it yourself with below code

import os

import csv

Base directory containing class directories

base_dir = '/home/hbai/shukurullo/tsm/temporal-shift-module/data_frames/test'

CSV file path

csv_file_path = 'test_data.csv'

Open the CSV file for writing

with open(csv_file_path, mode='w', newline='') as file: writer = csv.writer(file)

# Traverse through all class directories
for class_dir in os.listdir(base_dir):
    class_path = os.path.join(base_dir, class_dir)
    print(f'class_path: {class_path}')
    if os.path.isdir(class_path):
        # Traverse through all video files in the class directory
        for video_file in os.listdir(class_path):
            print(f'video_file: {video_file}')
            video_path = os.path.join(class_path, video_file)

            writer.writerow([class_dir, video_file])

print(f"CSV file '{csv_file_path}' created successfully.") '''