Commit 1b14c34362b22c2d4f151f9ec93ac4ddca0f4983

Authored by Chunk
1 parent cbdcbdd9
Exists in master and in 1 other branch refactor

cropping.

Showing 2 changed files with 6 additions and 5 deletions   Show diff stats
mdata/ILSVRC.py
@@ -450,7 +450,7 @@ class DataILSVRC(DataDumperBase): @@ -450,7 +450,7 @@ class DataILSVRC(DataDumperBase):
450 for line in tsvfile: 450 for line in tsvfile:
451 hash = line[0] 451 hash = line[0]
452 tag = line[-1] 452 tag = line[-1]
453 - image = os.path.join(self.feat_dir, hash[:3], hash[3:] + '.jpg') 453 + image = os.path.join(self.data_dir, hash[:3], hash[3:] + '.jpg')
454 if image: 454 if image:
455 im = Jpeg(image, key=sample_key) 455 im = Jpeg(image, key=sample_key)
456 dict_dataset[hash] = (tag, im.getCoefBlocks('Y')) 456 dict_dataset[hash] = (tag, im.getCoefBlocks('Y'))
test/test_data.py
@@ -136,13 +136,14 @@ def test_pipeline(): @@ -136,13 +136,14 @@ def test_pipeline():
136 136
137 def test_crop(): 137 def test_crop():
138 # crop.crop_Test() 138 # crop.crop_Test()
139 - dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Test_1')  
140 - dil.crop() 139 +
  140 + # dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Test_1')
  141 + # dil.crop()
141 142
142 dil2 = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Test_1_crop_pil') 143 dil2 = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Test_1_crop_pil')
143 144
144 - dil2.format()  
145 - dil2.embed(rate=0.2) 145 + # dil2.format()
  146 + # dil2.embed(rate=0.2)
146 147
147 X,Y = dil2.load_data(mode='local',feattype='coef') 148 X,Y = dil2.load_data(mode='local',feattype='coef')
148 print X[0] 149 print X[0]