-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathch_name.py
More file actions
35 lines (26 loc) · 1 KB
/
ch_name.py
File metadata and controls
35 lines (26 loc) · 1 KB
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
30
31
32
33
import glob
import numpy as np
import pandas as pd
import shutil
import pdb
if __name__ == "__main__":
clips_path = []
folds = glob.glob("./TIM_224by224/*")
folds.sort()
for index_fold in range(len(folds)):
clips_full_pth = glob.glob(folds[index_fold]+"/*")
clips_full_pth.sort()
len_clips = len(clips_full_pth)
clips_full_pth = [ele[15:] for ele in clips_full_pth]
clips_path = clips_path + clips_full_pth
for index_clips in range(len(clips_path)):
source_address = "./TIM_224by224/"+clips_path[index_clips]
index = "%05d"%(index_clips+1)
dist_address = "./TIM_224by224_need/"+index
shutil.copytree(source_address, dist_address)
#clips_path = np.array(clips_path)
#lables = np.array(labels)
#output = np.array([clips_path, labels])
#output = output.T
#df = pd.DataFrame(output, columns=['data','labels','train_flag'])
#df.to_csv('./UCF101.csv')