-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.py
52 lines (43 loc) · 1.2 KB
/
link.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
48
49
50
51
52
#
import os
from xmlSet import mainFunction
from Transform import *
from scipy.misc import imread
def linkImgAnn(cp):
data, ann = cp
dataDir = '/'.join(data.split('/')[0:2])
annDir = '/'.join(ann.split('/')[0:2])
extend = '_Aug'
def readFile():
testFile = '/data_1/ssd-project/SSD_data_augment/data/list.txt'
for bond in open(testFile):
#print(bond)
both = bond.split()
yield both
'''
if os.path.exists(both[0]) and os.path.exists(both[1]) :
linkImgANN(both)
'''
def readAnnoImage():
# read xmlAnno
couples = readFile()
xx = (1,)
for cp in couples:
try:
img, anno = cp
print img,
if img=='VOC2012/JPEGImages/2009_002851.jpg':
print 'oo'
data, labels, origin_data = mainFunction(img, anno)
tmp = []
for i in labels.keys():
tmp.append(labels[i]['name'])
xx += tuple(tmp)
# print 'o'
###deal with data & its labels
# show_data(data, labels)
except Exception, e:
print 'line:', e
print xx
if __name__ == "__main__":
readAnnoImage()