-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.py
47 lines (27 loc) · 912 Bytes
/
temp.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
37
38
39
40
41
42
43
44
45
46
47
from create_dataset import createDataset
file1 = open('/home/saksham/Desktop/research/mnt/ramdisk/max/90kDICT32px/lexicon.txt')
annotations = []
while True :
line = file1.readline()
if not line :
break
annotations.append(line.strip())
file1.close()
file2 = open('/home/saksham/Desktop/research/mnt/ramdisk/max/90kDICT32px/annotation_test.txt')
imagePathList = []
labelList = []
pth = '/home/saksham/Desktop/research/mnt/ramdisk/max/90kDICT32px'
while True :
line = file2.readline()
if not line :
break
line = line.strip('\n')
arr = line.split(' ')
index = int(arr[1])
path = arr[0][1:]
path = pth + path
imagePathList.append(path)
labelList.append(annotations[index])
file2.close()
print("CREATING DATASET")
createDataset('/home/saksham/Desktop/research/data/test', imagePathList, labelList)