“267275d9c66f7c59a93b8ae058a5f52d01f13c6e”上不存在“paddle/phi/kernels/flatten_kernel.cc”
split_data.py 646 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
import os
import shutil

# set path
train_path = 'train/'
if not os.path.exists(train_path):
    os.makedirs(train_path)

test_path = 'test/'
if not os.path.exists(test_path):
    os.makedirs(test_path)

# move data
frame_dir = 'frame/'
f = open('ucfTrainTestlist/trainlist01.txt')
for line in f.readlines():
    folder = line.split('.')[0]
    vidid = folder.split('/')[-1]

    shutil.move(frame_dir + folder, train_path + vidid)
f.close()

f = open('ucfTrainTestlist/testlist01.txt')
for line in f.readlines():
    folder = line.split('.')[0]
    vidid = folder.split('/')[-1]

    shutil.move(frame_dir + folder, test_path + vidid)
f.close()