__init__.py
1.39 KB
1
2
3
4
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
__author__ = 'chunk'
__all__ = ['DataDumperBase', ]
class DataDumperBase(object):
"""
Base class for image data dumping & retrieving.
A regular directory pattern would be like this:
├── file-tag-list.tsv
│
├── 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;
"""
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
def get_table(self, tablename, connection=None):
pass
def store_img(self, table):
pass
def store_tag(self, table, category):
pass
def get_feat(self, category):
pass
def store_feat(self, table, category):
pass