From ad70caf61e501cd876a0aca3bc5c089e30a6f7ba Mon Sep 17 00:00:00 2001 From: Chunk Date: Wed, 8 Apr 2015 19:42:31 +0800 Subject: [PATCH] staged. --- mdata/CV.py | 2 +- mdata/ILSVRC.py | 4 ++-- mdata/MSR.py | 4 ++-- test/test_data.py | 22 +++++++++++++--------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/mdata/CV.py b/mdata/CV.py index c888eb1..62b9d0a 100644 --- a/mdata/CV.py +++ b/mdata/CV.py @@ -99,7 +99,7 @@ class DataCV(DataDumperBase): return table - def store_image(self): + def store_img(self): if self.table == None: self.table = self.get_table() diff --git a/mdata/ILSVRC.py b/mdata/ILSVRC.py index d35baea..7e379a2 100644 --- a/mdata/ILSVRC.py +++ b/mdata/ILSVRC.py @@ -292,7 +292,7 @@ class DataILSVRC(DataDumperBase): return table - def store_image(self): + def store_img(self): if self.table == None: self.table = self.get_table() @@ -302,7 +302,7 @@ class DataILSVRC(DataDumperBase): tsvfile = csv.reader(tsvfile, delimiter='\t') for line in tsvfile: path_img = os.path.join(self.img_dir, line[0][:3], line[0][3:] + '.jpg') - if path_img: + if path_img: with open(path_img, 'rb') as fpic: dict_databuf[line[0] + '.jpg'] = fpic.read() diff --git a/mdata/MSR.py b/mdata/MSR.py index 45258a2..d479618 100644 --- a/mdata/MSR.py +++ b/mdata/MSR.py @@ -101,7 +101,7 @@ class DataMSR(DataDumperBase): return table - def store_image(self): + def store_img(self): if self.table == None: self.table = self.get_table() @@ -265,4 +265,4 @@ class DataMSR(DataDumperBase): X.append(data[0]) Y.append(data[1]) - return X, Y \ No newline at end of file + return X, Y diff --git a/test/test_data.py b/test/test_data.py index 3334dbd..07a51ac 100755 --- a/test/test_data.py +++ b/test/test_data.py @@ -31,25 +31,29 @@ def test_CV(): def test_ILSVRC(): timer = Timer() # dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train') - # dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Test') - dil = ILSVRC.DataILSVRC(base_dir='/media/chunk/Elements/D/data/ImageNet/img/ILSVRC2013_DET_val', category='Train_1') + dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_1') + # dil = ILSVRC.DataILSVRC(base_dir='/media/chunk/Elements/D/data/ImageNet/img/ILSVRC2013_DET_val', category='Train_1') - # dil.format() - # dil.embed(rate=0.1) - # dil.extract_feat(feattype='ibd') + dil.format() + dil.embed(rate=0.1) + dil.extract_feat(feattype='ibd') # dil.extract_feat(feattype='hog') timer.mark() dil.store_img() timer.report() - # + + timer.mark() + dil.store_tag() + timer.report() + timer.mark() dil.store_info() timer.report() - # timer.mark() - # dil.store_info() - # timer.report() + timer.mark() + dil.store_feat() + timer.report() if __name__ == '__main__': -- libgit2 0.21.2