forked from KaiyangZhou/deep-person-reid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
63 lines (54 loc) · 1.64 KB
/
__init__.py
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
from __future__ import absolute_import
from .resnet import *
from .resnetmid import *
from .resnext import *
from .senet import *
from .densenet import *
from .inceptionresnetv2 import *
from .inceptionv4 import *
from .xception import *
from .nasnet import *
from .mobilenetv2 import *
from .shufflenet import *
from .squeezenet import *
from .mudeep import *
from .hacnn import *
from .pcb import *
from .mlfn import *
__model_factory = {
# image classification models
'resnet50': resnet50,
'resnet50_fc512': resnet50_fc512,
'resnext50_32x4d': resnext50_32x4d,
'resnext50_32x4d_fc512': resnext50_32x4d_fc512,
'se_resnet50': se_resnet50,
'se_resnet50_fc512': se_resnet50_fc512,
'se_resnet101': se_resnet101,
'se_resnext50_32x4d': se_resnext50_32x4d,
'se_resnext101_32x4d': se_resnext101_32x4d,
'densenet121': densenet121,
'densenet121_fc512': densenet121_fc512,
'inceptionresnetv2': inceptionresnetv2,
'inceptionv4': inceptionv4,
'xception': xception,
# lightweight models
'nasnsetmobile': nasnetamobile,
'mobilenetv2': MobileNetV2,
'shufflenet': shufflenet,
'squeezenet1_0': squeezenet1_0,
'squeezenet1_0_fc512': squeezenet1_0_fc512,
'squeezenet1_1': squeezenet1_1,
# reid-specific models
'mudeep': MuDeep,
'resnet50mid': resnet50mid,
'hacnn': HACNN,
'pcb_p6': pcb_p6,
'pcb_p4': pcb_p4,
'mlfn': mlfn,
}
def get_names():
return list(__model_factory.keys())
def init_model(name, *args, **kwargs):
if name not in list(__model_factory.keys()):
raise KeyError('Unknown model: {}'.format(name))
return __model_factory[name](*args, **kwargs)