From 35cf2e3a65bffa59197629a0c54cf244d5773456 Mon Sep 17 00:00:00 2001 From: Chunk Date: Thu, 9 Apr 2015 21:01:00 +0800 Subject: [PATCH] staged. --- mdata/ILSVRC_S.py | 5 +++-- test/test_data.py | 14 +++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mdata/ILSVRC_S.py b/mdata/ILSVRC_S.py index f88bb07..3c2a148 100644 --- a/mdata/ILSVRC_S.py +++ b/mdata/ILSVRC_S.py @@ -41,7 +41,7 @@ class DataILSVRC_S(DataDumperBase): Each step includes reading from & writing to Hbase (though PC). And each step must have a 'spark' mode option, which means that the operation is performed by spark with reading & wrting through RDDs. - chunkplus@gmail.com + copyright(c) 2015 chunkplus@gmail.com """ def __init__(self, base_dir='/media/chunk/Elements/D/data/ImageNet/img/ILSVRC2013_DET_val', category='Train'): @@ -191,7 +191,8 @@ class DataILSVRC_S(DataDumperBase): tmpf_dst = tempfile.NamedTemporaryFile(suffix='.jpg', mode='w+b') if rate == None: - embed_rate = f5.embed_raw_data(tmpf_src.name, os.path.join(package_dir, '../res/toembed'), tmpf_dst.name) + embed_rate = f5.embed_raw_data(tmpf_src.name, os.path.join(package_dir, '../res/toembed'), + tmpf_dst.name) else: assert (rate >= 0 and rate < 1) # print capacity diff --git a/test/test_data.py b/test/test_data.py index c59c57e..feb7d1d 100755 --- a/test/test_data.py +++ b/test/test_data.py @@ -58,11 +58,19 @@ def test_ILSVRC(): def test_ILSVRC_S(): timer = Timer() + + dil = ILSVRC.DataILSVRC(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_2') + dil.format() + dil.store_img() + + dils = ILSVRC_S.DataILSVRC_S(base_dir='/data/hadoop/ImageNet/ILSVRC/ILSVRC2013_DET_val', category='Train_2') - dils._extract_data(mode='hbase', writeback=True) - dils._embed_data(mode='hbase', rate=0.1, readforward=True, writeback=True) - dils._extract_feat( mode='hbase', feattype='ibd', readforward=True, writeback=True) + # dils._extract_data(mode='hbase', writeback=True) + # dils._embed_data(mode='hbase', rate=0.1, readforward=True, writeback=True) + # dils._extract_feat( mode='hbase', feattype='ibd', readforward=True, writeback=True) + + dils.format() if __name__ == '__main__': # test_MSR() -- libgit2 0.21.2