Blame view

mdata/__init__.py 1.39 KB
0d9a20ea   Chunk   staged.
1
__author__ = 'chunk'
c7fa1d60   Chunk   refractoration st...
2
3

__all__ = ['DataDumperBase', ]
0d9a20ea   Chunk   staged.
4

c7fa1d60   Chunk   refractoration st...
5
6
7
8
9
10
11

class DataDumperBase(object):
    """
    Base class for image data dumping & retrieving.
    A regular directory pattern would be like this:

        ├── file-tag-list.tsv
be12257b   Chunk   data-feat-model f...
12
0d9a20ea   Chunk   staged.
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
        ├── Feat
        │   ├── 0a1
        │   └── 53e
        │   └── ...
        |
        └── Img
            ├── 0a1
            └── 53e
            └── ...

    It can be refractored from the original pattern which is supposed to be generated from web crawlers:

        ├── Neg
        │   ├── aaa.jpg
        │   └── bbb.jpg
        │   └── ...
        |
        └── Pos
            ├── ccc.jpg
            └── ddd.jpg
            └── ...

    convention:
        'img' for image file data while 'image' for file path;

    """

c7fa1d60   Chunk   refractoration st...
40
41
42
43
44
45
46
47
48
49
50
51
52
    def __init__(self):
        self.base_dir = None
        self.list_file = None
        self.dict_data = None

        # self.table_name = None
        # self.table = None
        # self.connection = None

    def format(self):
        pass


0d9a20ea   Chunk   staged.
53

be12257b   Chunk   data-feat-model f...
54
55
56
    def get_table(self, tablename, connection=None):
        pass

c7fa1d60   Chunk   refractoration st...
57
58
59
    def store_img(self, table):
        pass

0d9a20ea   Chunk   staged.
60
61
    def store_tag(self, table, category):
        pass
1dc7c44b   Chunk   crawler-hbase-spa...
62

0d9a20ea   Chunk   staged.
63
64
65
    def get_feat(self, category):
        pass

1dc7c44b   Chunk   crawler-hbase-spa...
66
    def store_feat(self, table, category):
0d9a20ea   Chunk   staged.
67
        pass
6d6d75b8   Chunk   spider LOG system.

0d9a20ea   Chunk   staged.

c7fa1d60   Chunk   refractoration st...

0d9a20ea   Chunk   staged.

c7fa1d60   Chunk   refractoration st...

0d9a20ea   Chunk   staged.

c7fa1d60   Chunk   refractoration st...

0d9a20ea   Chunk   staged.

c7fa1d60   Chunk   refractoration st...

2c2d57c7   Chunk   ILSVRC datapath h...

c7fa1d60   Chunk   refractoration st...

be12257b   Chunk   data-feat-model f...

c7fa1d60   Chunk   refractoration st...

be12257b   Chunk   data-feat-model f...

c7fa1d60   Chunk   refractoration st...

be12257b   Chunk   data-feat-model f...