-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_copy.py
More file actions
21 lines (17 loc) · 775 Bytes
/
random_copy.py
File metadata and controls
21 lines (17 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import shutil
import random
org_dir = '/home/ba4_project/ba4_Hee/timothy_workstation/data/training_dataset1/test2/pos'
dir = "/home/ba4_project/ba4_Hee/timothy_workstation/data/training_dataset1/ultimate_test/pos"
images = os.listdir(org_dir)
random_images = random.sample(images, k=100)
for image in random_images:
image_path = org_dir+'/'+ image
shutil.copy(image_path, dir)
org_dir = '/home/ba4_project/ba4_Hee/timothy_workstation/data/training_dataset1/test2/neg'
dir = "/home/ba4_project/ba4_Hee/timothy_workstation/data/training_dataset1/ultimate_test/neg"
images = os.listdir(org_dir)
random_images = random.sample(images, k=100)
for image in random_images:
image_path = org_dir+'/'+ image
shutil.copy(image_path, dir)