Skip to content

Commit 3efc83c

Browse files
authored
Add pretrained weights for CSPDarkNetTiny (#1251)
1 parent 2086ed2 commit 3efc83c

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

examples/training/classification/imagenet/training_history.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@
2020
"validation_accuracy": "0.7744"
2121
}
2222
},
23+
"cspdarknettiny": {
24+
"v0": {
25+
"accelerators": 8,
26+
"args": {
27+
"batch_size": "64",
28+
"initial_learning_rate": "0.0125",
29+
"use_ema": "True",
30+
"weight_decay": "0.0001"
31+
},
32+
"contributor": "ianstenbit",
33+
"epochs_trained": 136,
34+
"script": {
35+
"name": "basic_training.py",
36+
"version": "212e67fc9acb65c699b609e4cdae54552d22e6b4"
37+
},
38+
"tensorboard_logs": "https://tensorboard.dev/experiment/yaJKJ934QO2i9ozLFrnfZw/",
39+
"validation_accuracy": "0.6169"
40+
}
41+
},
2342
"darknet53": {
2443
"v0": {
2544
"accelerators": 8,

keras_cv/models/csp_darknet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def CSPDarkNetTiny(
272272
include_top=include_top,
273273
use_depthwise=use_depthwise,
274274
classes=classes,
275-
weights=weights,
275+
weights=parse_weights(weights, include_top, "cspdarknettiny"),
276276
input_shape=input_shape,
277277
input_tensor=input_tensor,
278278
pooling=pooling,
@@ -362,7 +362,7 @@ def CSPDarkNetL(
362362
include_top=include_top,
363363
use_depthwise=use_depthwise,
364364
classes=classes,
365-
weights=parse_weights(weights, include_top, "cspdarknet"),
365+
weights=parse_weights(weights, include_top, "cspdarknetl"),
366366
input_shape=input_shape,
367367
input_tensor=input_tensor,
368368
pooling=pooling,

keras_cv/models/weights.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def parse_weights(weights, include_top, model_type):
3939
BASE_PATH = "https://storage.googleapis.com/keras-cv/models"
4040

4141
ALIASES = {
42-
"cspdarknet": {
42+
"cspdarknetl": {
43+
"imagenet": "imagenet/classification-v0",
44+
"imagenet/classification": "imagenet/classification-v0",
45+
},
46+
"cspdarknettiny": {
4347
"imagenet": "imagenet/classification-v0",
4448
"imagenet/classification": "imagenet/classification-v0",
4549
},
@@ -113,10 +117,14 @@ def parse_weights(weights, include_top, model_type):
113117
}
114118

115119
WEIGHTS_CONFIG = {
116-
"cspdarknet": {
120+
"cspdarknetl": {
117121
"imagenet/classification-v0": "8bdc3359222f0d26f77aa42c4e97d67a05a1431fe6c448ceeab9a9c5a34ff804",
118122
"imagenet/classification-v0-notop": "9303aabfadffbff8447171fce1e941f96d230d8f3cef30d3f05a9c85097f8f1e",
119123
},
124+
"cspdarknettiny": {
125+
"imagenet/classification-v0": "c17fe6d7b597f2eb25e42fbd97ec58fb1dad753ba18920cc27820953b7947704",
126+
"imagenet/classification-v0-notop": "0007ae82c95be4d4aef06368a7c38e006381324d77e5df029b04890e18a8ad19",
127+
},
120128
"darknet53": {
121129
"imagenet/classification-v0": "7bc5589f7f7f7ee3878e61ab9323a71682bfb617eb57f530ca8757c742f00c77",
122130
"imagenet/classification-v0-notop": "8dcce43163e4b4a63e74330ba1902e520211db72d895b0b090b6bfe103e7a8a5",

0 commit comments

Comments
 (0)