minor updates
Browse files- app.py +11 -5
- model_utils/efficientnet_config.py +2 -1
app.py
CHANGED
@@ -42,7 +42,9 @@ effnet_hparams = {47: {"num_classes": 2,
|
|
42 |
"dropout": 0.039061686292663655,
|
43 |
"width_mult": 0.7540060155156922,
|
44 |
"depth_mult": 0.9378692812212488,
|
45 |
-
"size": "v2_s"
|
|
|
|
|
46 |
61: {
|
47 |
"num_classes": 2,
|
48 |
"gamma": 0.032606396652426956,
|
@@ -54,7 +56,9 @@ effnet_hparams = {47: {"num_classes": 2,
|
|
54 |
"dropout": 0.027804120950575217,
|
55 |
"width_mult": 1.060782511229692,
|
56 |
"depth_mult": 0.7752918857163054,
|
57 |
-
"size": "v2_s"
|
|
|
|
|
58 |
75: {
|
59 |
"num_classes": 2,
|
60 |
"gamma": 0.029768470449465057,
|
@@ -66,7 +70,8 @@ effnet_hparams = {47: {"num_classes": 2,
|
|
66 |
"dropout": 0.03351826828687193,
|
67 |
"width_mult": 1.144132674734038,
|
68 |
"depth_mult": 1.2267023928285563,
|
69 |
-
"size": "v2_s"
|
|
|
70 |
}
|
71 |
}
|
72 |
# effnet_config = SimpleNamespace(**effnet_hparams)
|
@@ -245,9 +250,10 @@ def predict_and_analyze(model_name, num_channels, dim, input_channel, image):
|
|
245 |
width_mult=hparams.width_mult,
|
246 |
depth_mult=hparams.depth_mult,
|
247 |
)
|
248 |
-
EfficientNetConfig.model_type = "efficientnet_%s_planet_detection" % (hparams.num_channels)
|
|
|
249 |
|
250 |
-
|
251 |
# config = EfficientNetConfig.from_pretrained(model_loading_name)
|
252 |
|
253 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
|
|
42 |
"dropout": 0.039061686292663655,
|
43 |
"width_mult": 0.7540060155156922,
|
44 |
"depth_mult": 0.9378692812212488,
|
45 |
+
"size": "v2_s",
|
46 |
+
"model_type": "efficientnet_47_planet_detection"
|
47 |
+
},
|
48 |
61: {
|
49 |
"num_classes": 2,
|
50 |
"gamma": 0.032606396652426956,
|
|
|
56 |
"dropout": 0.027804120950575217,
|
57 |
"width_mult": 1.060782511229692,
|
58 |
"depth_mult": 0.7752918857163054,
|
59 |
+
"size": "v2_s",
|
60 |
+
"model_type": "efficientnet_61_planet_detection"
|
61 |
+
},
|
62 |
75: {
|
63 |
"num_classes": 2,
|
64 |
"gamma": 0.029768470449465057,
|
|
|
70 |
"dropout": 0.03351826828687193,
|
71 |
"width_mult": 1.144132674734038,
|
72 |
"depth_mult": 1.2267023928285563,
|
73 |
+
"size": "v2_s",
|
74 |
+
"model_type": "efficientnet_75_planet_detection"
|
75 |
}
|
76 |
}
|
77 |
# effnet_config = SimpleNamespace(**effnet_hparams)
|
|
|
250 |
width_mult=hparams.width_mult,
|
251 |
depth_mult=hparams.depth_mult,
|
252 |
)
|
253 |
+
# EfficientNetConfig.model_type = "efficientnet_%s_planet_detection" % (hparams.num_channels)
|
254 |
+
EfficientNetConfig.model_type = hparams.model_type
|
255 |
|
256 |
+
config.save_pretrained(save_directory=model_loading_name)
|
257 |
# config = EfficientNetConfig.from_pretrained(model_loading_name)
|
258 |
|
259 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
model_utils/efficientnet_config.py
CHANGED
@@ -242,7 +242,8 @@ class FusedMBConv(nn.Module):
|
|
242 |
|
243 |
class EfficientNetConfig(PretrainedConfig):
|
244 |
|
245 |
-
model_type = "efficientnet"
|
|
|
246 |
|
247 |
def __init__(
|
248 |
self,
|
|
|
242 |
|
243 |
class EfficientNetConfig(PretrainedConfig):
|
244 |
|
245 |
+
# model_type = "efficientnet"
|
246 |
+
model_type = "efficientnet_61_planet_detection"
|
247 |
|
248 |
def __init__(
|
249 |
self,
|