Skip to content

Commit 3ce8f22

Browse files
committed
Remove unnecessary code
1 parent 18921b2 commit 3ce8f22

File tree

5 files changed

+0
-248
lines changed

5 files changed

+0
-248
lines changed

segmentation_models_pytorch/encoders/_dpn.py

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -16,84 +16,6 @@
1616

1717
__all__ = ["DPN", "dpn68", "dpn68b", "dpn92", "dpn98", "dpn131", "dpn107"]
1818

19-
pretrained_settings = {
20-
"dpn68": {
21-
"imagenet": {
22-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/dpn68-4af7d88d2.pth",
23-
"input_space": "RGB",
24-
"input_size": [3, 224, 224],
25-
"input_range": [0, 1],
26-
"mean": [124 / 255, 117 / 255, 104 / 255],
27-
"std": [1 / (0.0167 * 255)] * 3,
28-
"num_classes": 1000,
29-
}
30-
},
31-
"dpn68b": {
32-
"imagenet+5k": {
33-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/dpn68b_extra-363ab9c19.pth",
34-
"input_space": "RGB",
35-
"input_size": [3, 224, 224],
36-
"input_range": [0, 1],
37-
"mean": [124 / 255, 117 / 255, 104 / 255],
38-
"std": [1 / (0.0167 * 255)] * 3,
39-
"num_classes": 1000,
40-
}
41-
},
42-
"dpn92": {
43-
# 'imagenet': {
44-
# 'url': 'http://data.lip6.fr/cadene/pretrainedmodels/dpn68-66bebafa7.pth',
45-
# 'input_space': 'RGB',
46-
# 'input_size': [3, 224, 224],
47-
# 'input_range': [0, 1],
48-
# 'mean': [124 / 255, 117 / 255, 104 / 255],
49-
# 'std': [1 / (.0167 * 255)] * 3,
50-
# 'num_classes': 1000
51-
# },
52-
"imagenet+5k": {
53-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/dpn92_extra-fda993c95.pth",
54-
"input_space": "RGB",
55-
"input_size": [3, 224, 224],
56-
"input_range": [0, 1],
57-
"mean": [124 / 255, 117 / 255, 104 / 255],
58-
"std": [1 / (0.0167 * 255)] * 3,
59-
"num_classes": 1000,
60-
}
61-
},
62-
"dpn98": {
63-
"imagenet": {
64-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/dpn98-722954780.pth",
65-
"input_space": "RGB",
66-
"input_size": [3, 224, 224],
67-
"input_range": [0, 1],
68-
"mean": [124 / 255, 117 / 255, 104 / 255],
69-
"std": [1 / (0.0167 * 255)] * 3,
70-
"num_classes": 1000,
71-
}
72-
},
73-
"dpn131": {
74-
"imagenet": {
75-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/dpn131-7af84be88.pth",
76-
"input_space": "RGB",
77-
"input_size": [3, 224, 224],
78-
"input_range": [0, 1],
79-
"mean": [124 / 255, 117 / 255, 104 / 255],
80-
"std": [1 / (0.0167 * 255)] * 3,
81-
"num_classes": 1000,
82-
}
83-
},
84-
"dpn107": {
85-
"imagenet+5k": {
86-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/dpn107_extra-b7f9f4cc9.pth",
87-
"input_space": "RGB",
88-
"input_size": [3, 224, 224],
89-
"input_range": [0, 1],
90-
"mean": [124 / 255, 117 / 255, 104 / 255],
91-
"std": [1 / (0.0167 * 255)] * 3,
92-
"num_classes": 1000,
93-
}
94-
},
95-
}
96-
9719

9820
def dpn68(num_classes=1000, pretrained="imagenet"):
9921
model = DPN(

segmentation_models_pytorch/encoders/_inceptionresnetv2.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,6 @@
55

66
__all__ = ["InceptionResNetV2", "inceptionresnetv2"]
77

8-
pretrained_settings = {
9-
"inceptionresnetv2": {
10-
"imagenet": {
11-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/inceptionresnetv2-520b38e4.pth",
12-
"input_space": "RGB",
13-
"input_size": [3, 299, 299],
14-
"input_range": [0, 1],
15-
"mean": [0.5, 0.5, 0.5],
16-
"std": [0.5, 0.5, 0.5],
17-
"num_classes": 1000,
18-
},
19-
"imagenet+background": {
20-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/inceptionresnetv2-520b38e4.pth",
21-
"input_space": "RGB",
22-
"input_size": [3, 299, 299],
23-
"input_range": [0, 1],
24-
"mean": [0.5, 0.5, 0.5],
25-
"std": [0.5, 0.5, 0.5],
26-
"num_classes": 1001,
27-
},
28-
}
29-
}
30-
318

329
class BasicConv2d(nn.Module):
3310
def __init__(self, in_planes, out_planes, kernel_size, stride, padding=0):
@@ -359,23 +336,3 @@ def inceptionresnetv2(num_classes=1000, pretrained="imagenet"):
359336
else:
360337
model = InceptionResNetV2(num_classes=num_classes)
361338
return model
362-
363-
364-
"""
365-
TEST
366-
Run this code with:
367-
```
368-
cd $HOME/pretrained-models.pytorch
369-
python -m pretrainedmodels.inceptionresnetv2
370-
```
371-
"""
372-
if __name__ == "__main__":
373-
assert inceptionresnetv2(num_classes=10, pretrained=None)
374-
print("success")
375-
assert inceptionresnetv2(num_classes=1000, pretrained="imagenet")
376-
print("success")
377-
assert inceptionresnetv2(num_classes=1001, pretrained="imagenet+background")
378-
print("success")
379-
380-
# fail
381-
assert inceptionresnetv2(num_classes=1001, pretrained="imagenet")

segmentation_models_pytorch/encoders/_inceptionv4.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,6 @@
66

77
__all__ = ["InceptionV4", "inceptionv4"]
88

9-
pretrained_settings = {
10-
"inceptionv4": {
11-
"imagenet": {
12-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/inceptionv4-8e4777a0.pth",
13-
"input_space": "RGB",
14-
"input_size": [3, 299, 299],
15-
"input_range": [0, 1],
16-
"mean": [0.5, 0.5, 0.5],
17-
"std": [0.5, 0.5, 0.5],
18-
"num_classes": 1000,
19-
},
20-
"imagenet+background": {
21-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/inceptionv4-8e4777a0.pth",
22-
"input_space": "RGB",
23-
"input_size": [3, 299, 299],
24-
"input_range": [0, 1],
25-
"mean": [0.5, 0.5, 0.5],
26-
"std": [0.5, 0.5, 0.5],
27-
"num_classes": 1001,
28-
},
29-
}
30-
}
31-
329

3310
class BasicConv2d(nn.Module):
3411
def __init__(self, in_planes, out_planes, kernel_size, stride, padding=0):
@@ -345,23 +322,3 @@ def inceptionv4(num_classes=1000, pretrained="imagenet"):
345322
else:
346323
model = InceptionV4(num_classes=num_classes)
347324
return model
348-
349-
350-
"""
351-
TEST
352-
Run this code with:
353-
```
354-
cd $HOME/pretrained-models.pytorch
355-
python -m pretrainedmodels.inceptionv4
356-
```
357-
"""
358-
if __name__ == "__main__":
359-
assert inceptionv4(num_classes=10, pretrained=None)
360-
print("success")
361-
assert inceptionv4(num_classes=1000, pretrained="imagenet")
362-
print("success")
363-
assert inceptionv4(num_classes=1001, pretrained="imagenet+background")
364-
print("success")
365-
366-
# fail
367-
assert inceptionv4(num_classes=1001, pretrained="imagenet")

segmentation_models_pytorch/encoders/_senet.py

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -20,75 +20,6 @@
2020
"se_resnext101_32x4d",
2121
]
2222

23-
pretrained_settings = {
24-
"senet154": {
25-
"imagenet": {
26-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/senet154-c7b49a05.pth",
27-
"input_space": "RGB",
28-
"input_size": [3, 224, 224],
29-
"input_range": [0, 1],
30-
"mean": [0.485, 0.456, 0.406],
31-
"std": [0.229, 0.224, 0.225],
32-
"num_classes": 1000,
33-
}
34-
},
35-
"se_resnet50": {
36-
"imagenet": {
37-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/se_resnet50-ce0d4300.pth",
38-
"input_space": "RGB",
39-
"input_size": [3, 224, 224],
40-
"input_range": [0, 1],
41-
"mean": [0.485, 0.456, 0.406],
42-
"std": [0.229, 0.224, 0.225],
43-
"num_classes": 1000,
44-
}
45-
},
46-
"se_resnet101": {
47-
"imagenet": {
48-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/se_resnet101-7e38fcc6.pth",
49-
"input_space": "RGB",
50-
"input_size": [3, 224, 224],
51-
"input_range": [0, 1],
52-
"mean": [0.485, 0.456, 0.406],
53-
"std": [0.229, 0.224, 0.225],
54-
"num_classes": 1000,
55-
}
56-
},
57-
"se_resnet152": {
58-
"imagenet": {
59-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/se_resnet152-d17c99b7.pth",
60-
"input_space": "RGB",
61-
"input_size": [3, 224, 224],
62-
"input_range": [0, 1],
63-
"mean": [0.485, 0.456, 0.406],
64-
"std": [0.229, 0.224, 0.225],
65-
"num_classes": 1000,
66-
}
67-
},
68-
"se_resnext50_32x4d": {
69-
"imagenet": {
70-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/se_resnext50_32x4d-a260b3a4.pth",
71-
"input_space": "RGB",
72-
"input_size": [3, 224, 224],
73-
"input_range": [0, 1],
74-
"mean": [0.485, 0.456, 0.406],
75-
"std": [0.229, 0.224, 0.225],
76-
"num_classes": 1000,
77-
}
78-
},
79-
"se_resnext101_32x4d": {
80-
"imagenet": {
81-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/se_resnext101_32x4d-3b2fe3d8.pth",
82-
"input_space": "RGB",
83-
"input_size": [3, 224, 224],
84-
"input_range": [0, 1],
85-
"mean": [0.485, 0.456, 0.406],
86-
"std": [0.229, 0.224, 0.225],
87-
"num_classes": 1000,
88-
}
89-
},
90-
}
91-
9223

9324
class SEModule(nn.Module):
9425
def __init__(self, channels, reduction):

segmentation_models_pytorch/encoders/_xception.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@
2929

3030
__all__ = ["xception"]
3131

32-
pretrained_settings = {
33-
"xception": {
34-
"imagenet": {
35-
"url": "http://data.lip6.fr/cadene/pretrainedmodels/xception-43020ad28.pth",
36-
"input_space": "RGB",
37-
"input_size": [3, 299, 299],
38-
"input_range": [0, 1],
39-
"mean": [0.5, 0.5, 0.5],
40-
"std": [0.5, 0.5, 0.5],
41-
"num_classes": 1000,
42-
"scale": 0.8975, # The resize parameter of the validation transform should be 333, and make sure to center crop at 299x299
43-
}
44-
}
45-
}
46-
4732

4833
class SeparableConv2d(nn.Module):
4934
def __init__(

0 commit comments

Comments
 (0)