0d9a20ea
Chunk
staged.
|
1
2
|
__author__ = 'chunk'
|
2c2d57c7
Chunk
ILSVRC datapath h...
|
3
|
from ..common import *
|
be12257b
Chunk
data-feat-model f...
|
4
|
|
84648488
Chunk
reverted.
|
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
|
from ..mdata import MSR, CV, ILSVRC, ILSVRC_S, crop
from ..mmodel.caffe.helper import *
def test_MSR():
dmsr = MSR.DataMSR()
# msrd.format()
# msrd.build_list()
# dmsr.store_image()
# dmsr.store_tag()
# dmsr.extract_feat(feattype='ibd')
dmsr.store_feat(feattype='ibd')
def test_CV():
dcv = CV.DataCV()
# dcv.format()
# dcv.build_list()
# dcv.get_feat()
# dcv.extract_feat()
print dcv.get_feat("/home/hadoop/data/HeadShoulder/dst/Train/Img/132/7c5fe33bd194fc1ae7b0023956ebd.jpg", 'ibd')
X, Y = dcv.load_data()
print len(X), len(Y)
|
be12257b
Chunk
data-feat-model f...
|
31
|
|
24b3b616
Chunk
staged.
|
32
|
def test_ILSVRC(category='Train_100'):
|
1821e0e3
Chunk
benchmarking...
|
33
|
timer = Timer()
|
554a7b9a
Chunk
staged.
|
34
|
|
1821e0e3
Chunk
benchmarking...
|
35
|
# dil = ILSVRC.DataILSVRC(base='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train')
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
36
|
dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category=category)
|
84648488
Chunk
reverted.
|
37
|
# dil = ILSVRC.DataILSVRC(base='/media/chunk/Elements/D/data/ImageNet/img/ILSVRC2013_DET_val', category='Train_1')
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
38
|
print '[time]category:', category
|
1821e0e3
Chunk
benchmarking...
|
39
|
|
554a7b9a
Chunk
staged.
|
40
|
timer.mark()
|
02528074
Chunk
staged.
|
41
|
print '[time]formatting...'
|
1821e0e3
Chunk
benchmarking...
|
42
|
dil.format()
|
ad70caf6
Chunk
staged.
|
43
|
timer.report()
|
02528074
Chunk
staged.
|
44
45
46
|
timer.mark()
print '[time]embedding...'
|
1821e0e3
Chunk
benchmarking...
|
47
|
dil.embed(rate=0.2)
|
02528074
Chunk
staged.
|
48
49
|
timer.report()
|
2c2d57c7
Chunk
ILSVRC datapath h...
|
50
|
timer.mark()
|
554a7b9a
Chunk
staged.
|
51
|
print '[time]extracting...'
|
1821e0e3
Chunk
benchmarking...
|
52
|
dil.extract_feat(feattype='ibd')
|
02528074
Chunk
staged.
|
53
|
timer.report()
|
554a7b9a
Chunk
staged.
|
54
|
|
489c5608
Chunk
debugging...
|
55
|
# dil.extract_feat(feattype='hog')
|
02528074
Chunk
staged.
|
56
57
|
# timer.mark()
|
4f36b116
Chunk
staged.
|
58
59
60
|
# dil.store_img()
# timer.report()
|
ad70caf6
Chunk
staged.
|
61
|
# timer.mark()
|
4f36b116
Chunk
staged.
|
62
63
64
65
66
67
68
69
70
71
72
|
# dil.store_tag()
# timer.report()
#
# timer.mark()
# dil.store_info()
# timer.report()
#
# timer.mark()
# dil.store_feat()
# timer.report()
|
554a7b9a
Chunk
staged.
|
73
|
|
cb798a7f
Chunk
libs & scripts in...
|
74
|
def test_ILSVRC_S_LOCAL():
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
75
|
timer = Timer()
|
24768a99
Chunk
mode 'hbase' fini...
|
76
|
|
35cf2e3a
Chunk
staged.
|
77
|
timer.mark()
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
78
|
dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_2')
|
84648488
Chunk
reverted.
|
79
|
dil.delete_table()
|
d47ae6ce
Chunk
staged.
|
80
81
82
|
dil.format()
dil.store_img()
timer.report()
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
83
|
|
35cf2e3a
Chunk
staged.
|
84
|
dils = ILSVRC_S.DataILSVRC_S(base='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_2')
|
84648488
Chunk
reverted.
|
85
|
|
35cf2e3a
Chunk
staged.
|
86
|
# dils._extract_data(mode='hbase', writeback=True)
|
35cf2e3a
Chunk
staged.
|
87
|
# dils._embed_data(mode='hbase', rate=0.1, readforward=True, writeback=True)
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
88
89
90
91
92
93
94
95
96
97
|
# dils._extract_feat( mode='hbase', feattype='ibd', readforward=True, writeback=True)
dils._extract_data(mode='hbase', writeback=False)
dils._embed_data(mode='hbase', rate=0.1, readforward=False, writeback=False)
dils._extract_feat(mode='hbase', feattype='ibd', readforward=False, writeback=True)
timer.report()
def test_ILSVRC_S_SPARK(category='Train_1000'):
|
26616791
Chunk
RDD-hbase bug fix...
|
98
|
timer = Timer()
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
99
100
|
timer.mark()
|
54e2adda
Chunk
staged.
|
101
|
dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category=category)
|
84648488
Chunk
reverted.
|
102
|
dil.delete_table()
|
54e2adda
Chunk
staged.
|
103
|
dil.format()
|
f4fb4381
Chunk
staged.
|
104
|
dil.store_img()
|
54e2adda
Chunk
staged.
|
105
106
|
timer.report()
# return
|
26616791
Chunk
RDD-hbase bug fix...
|
107
|
|
489c5608
Chunk
debugging...
|
108
|
dils = ILSVRC_S.DataILSVRC_S(base='ILSVRC2013_DET_val', category=category)
|
1821e0e3
Chunk
benchmarking...
|
109
|
|
489c5608
Chunk
debugging...
|
110
|
timer.mark()
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
111
|
dils._extract_data(mode='spark', writeback=False)
|
489c5608
Chunk
debugging...
|
112
|
timer.report()
|
489c5608
Chunk
debugging...
|
113
|
|
84648488
Chunk
reverted.
|
114
|
# print dils.rdd_data.count() # pass
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
115
116
|
# return
|
b9990e77
Chunk
staged.
|
117
|
timer.mark()
|
4f36b116
Chunk
staged.
|
118
|
dils._embed_data(mode='spark', rate=0.2, readforward=False, writeback=False)
|
e3e7e73a
Chunk
spider standalone...
|
119
120
|
timer.report()
|
e3ec1f74
Chunk
staged.
|
121
122
123
|
timer.mark()
dils._extract_feat(mode='spark', feattype='ibd', readforward=False, writeback=True, withdata=True)
timer.report()
|
f4fb4381
Chunk
staged.
|
124
|
|
e3ec1f74
Chunk
staged.
|
125
126
127
|
def test_ILSVRC_S():
# test_ILSVRC_S_LOCAL()
|
e3e7e73a
Chunk
spider standalone...
|
128
|
test_ILSVRC_S_SPARK()
|
4f36b116
Chunk
staged.
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
def test_pipeline():
timer = Timer()
timer.mark()
dils = ILSVRC_S.DataILSVRC_S(base='MSPIDER', category=None)
dils._extract_data(mode='spark', writeback=False)
dils._embed_data(mode='spark', rate=0.1, readforward=False, writeback=False)
dils._extract_feat(mode='spark', feattype='ibd', readforward=False, writeback=True, withdata=True)
timer.report()
def test_crop():
# crop.crop_Test()
dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_5000')
dil.crop(size=(200, 200))
dil2 = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_5000_crop_pil')
|
e3e7e73a
Chunk
spider standalone...
|
152
153
154
155
156
|
dil2.format()
dil2.embed(rate=0.2)
X, Y = dil2.load_data(mode='local', feattype='coef')
|
e3e7e73a
Chunk
spider standalone...
|
157
|
print X[0]
|
f4fb4381
Chunk
staged.
|
158
|
print Y
|
e3e7e73a
Chunk
spider standalone...
|
159
160
161
|
print np.array(X).shape, np.array(Y).shape
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
162
163
164
165
166
|
def test_caffe():
# read_lmdb(lmdb_name=os.path.join(caffe_root, 'examples/imager/data_lmdb'))
# return
dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_5000_crop_pil')
|
4f36b116
Chunk
staged.
|
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
X, Y = dil.load_data(mode='local', feattype='coef')
print X[0]
print Y
print np.array(X).shape, np.array(Y).shape
write_lmdb(X[2000:3000],Y[2000:3000])
if __name__ == '__main__':
# test_MSR()
# test_CV()
# test_ILSVRC()
# test_ILSVRC_S()
test_pipeline()
print 'helllo'
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
|
|
84648488
Chunk
reverted.
|
|
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
|
|
3b4e250d
Chunk
staged.
|
|
|
2c2d57c7
Chunk
ILSVRC datapath h...
|
|
|
84648488
Chunk
reverted.
|
|
|
51708346
Chunk
final experiments...
|
|
|
84648488
Chunk
reverted.
|
|
|
4f36b116
Chunk
staged.
|
|
|
84648488
Chunk
reverted.
|
|
|
24b3b616
Chunk
staged.
|
|
|
be12257b
Chunk
data-feat-model f...
|
|
|
2c2d57c7
Chunk
ILSVRC datapath h...
|
|
|
0fbc087e
Chunk
staged.
|
|
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
|
|
0fbc087e
Chunk
staged.
|
|
|
1dc7c44b
Chunk
crawler-hbase-spa...
|
|
|
be12257b
Chunk
data-feat-model f...
|
|
|
be12257b
Chunk
data-feat-model f...
|
|
|