-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpatch_move.py
23 lines (16 loc) · 887 Bytes
/
patch_move.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import numpy as np
import shutil
import os
labeled_list = np.loadtxt('label_list/sha-5.txt', dtype = str)
all_croped = os.listdir('part_A/uncertain_data/')
for file in all_croped:
if (file.split('_')[0] + '_' + file.split('_')[1] + '.jpg') in labeled_list:
shutil.copyfile('part_A/uncertain_data/' + file, 'part_A/uncertain_data_5/' + file )
labeled_list = np.loadtxt('label_list/sha-10.txt', dtype = str)
for file in all_croped:
if (file.split('_')[0] + '_' + file.split('_')[1] + '.jpg') in labeled_list:
shutil.copyfile('part_A/uncertain_data/' + file, 'part_A/uncertain_data_10/' + file )
labeled_list = np.loadtxt('label_list/sha-40.txt', dtype = str)
for file in all_croped:
if (file.split('_')[0] + '_' + file.split('_')[1] + '.jpg') in labeled_list:
shutil.copyfile('part_A/uncertain_data/' + file, 'part_A/uncertain_data_40/' + file )