-
Notifications
You must be signed in to change notification settings - Fork 7
/
merger.py
executable file
·36 lines (23 loc) · 1.11 KB
/
merger.py
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
34
35
36
# This is used for copying images from one folder to another.
# This is done by counting no. of images in destination folder,
# then renaming the source images starting from this count.
# Thus, the source images don't replace destination images because of renaming.
from os import listdir, system
from os.path import isfile
digit1 = 5
# Path from where to copy images (Source)
# newDataPath = "../training-images/Digits_Kartik/"+str(digit1)+"/Right_Hand/Normal/"
newDataPath = "/media/kartik/Kartik SK 1TB/Silatra/tejas/i/"
files = listdir(newDataPath)
files.sort()
# print(files)
# Path where you want to add more images (Destination)
# mergeDataPath = "../training-images/Digits/"+str(digit1)+"/Right_Hand/Normal/"
mergeDataPath = "/media/kartik/Kartik SK 1TB/Silatra/Letters/i/"
newCount = len(listdir(mergeDataPath)) + 1
print((newCount-1)," images present in "+mergeDataPath)
print("To start transfer, you need to manually edit the program")
for file1 in files:
system("cp '"+newDataPath+file1+"' '"+mergeDataPath+str(newCount)+".png'")
newCount+=1
print("\nCopied files from "+newDataPath+" to "+mergeDataPath)