Skip to content

Commit

Permalink
replace dataset name in cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
RangiLyu committed Jul 4, 2021
1 parent 739f844 commit 73ef835
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 25 deletions.
4 changes: 2 additions & 2 deletions config/EfficientNet-Lite/nanodet-EfficientNet-Lite0_320.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: /coco/train2017
ann_path: /coco/annotations/instances_train2017.json
input_size: [320,320] #[w,h]
Expand All @@ -66,7 +66,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[127.0, 127.0, 127.0], [128.0, 128.0, 128.0]]
val:
name: coco
name: CocoDataset
img_path: /coco/val2017
ann_path: /coco/annotations/instances_val2017.json
input_size: [320,320] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/EfficientNet-Lite/nanodet-EfficientNet-Lite1_416.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: /coco/train2017
ann_path: /coco/annotations/instances_train2017.json
input_size: [416,416] #[w,h]
Expand All @@ -67,7 +67,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[127.0, 127.0, 127.0], [128.0, 128.0, 128.0]]
val:
name: coco
name: CocoDataset
img_path: /coco/val2017
ann_path: /coco/annotations/instances_val2017.json
input_size: [416,416] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/EfficientNet-Lite/nanodet-EfficientNet-Lite2_512.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: /coco/train2017
ann_path: /coco/annotations/instances_train2017.json
input_size: [512,512] #[w,h]
Expand All @@ -67,7 +67,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[127.0, 127.0, 127.0], [128.0, 128.0, 128.0]]
val:
name: coco
name: CocoDataset
img_path: /coco/val2017
ann_path: /coco/annotations/instances_val2017.json
input_size: [512,512] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/RepVGG/nanodet-RepVGG-A0_416.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: /coco/train2017
ann_path: /coco/annotations/instances_train2017.json
input_size: [416,416] #[w,h]
Expand All @@ -63,7 +63,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: /coco/val2017
ann_path: /coco/annotations/instances_val2017.json
input_size: [416,416] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/Transformer/nanodet-t.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [320,320] #[w,h]
Expand All @@ -70,7 +70,7 @@ data:
saturation: [0.8, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [320,320] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet-g.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [416,416] #[w,h]
Expand All @@ -70,7 +70,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [416,416] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet-m-0.5x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [320,320] #[w,h]
Expand All @@ -65,7 +65,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [320,320] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet-m-1.5x-416.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [416,416] #[w,h]
Expand All @@ -65,7 +65,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [416,416] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet-m-1.5x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [320,320] #[w,h]
Expand All @@ -65,7 +65,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [320,320] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet-m-416.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [416,416] #[w,h]
Expand All @@ -65,7 +65,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [416,416] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet-m.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ model:
loss_weight: 2.0
data:
train:
name: coco
name: CocoDataset
img_path: coco/train2017
ann_path: coco/annotations/instances_train2017.json
input_size: [320,320] #[w,h]
Expand All @@ -59,7 +59,7 @@ data:
saturation: [0.5, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: coco
name: CocoDataset
img_path: coco/val2017
ann_path: coco/annotations/instances_val2017.json
input_size: [320,320] #[w,h]
Expand Down
4 changes: 2 additions & 2 deletions config/nanodet_custom_xml_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ model:
class_names: &class_names ['NAME1', 'NAME2', 'NAME3', 'NAME4', '...'] #Please fill in the category names (not include background category)
data:
train:
name: xml_dataset
name: XMLDataset
class_names: *class_names
img_path: TRAIN_IMAGE_FOLDER #Please fill in train image path
ann_path: TRAIN_XML_FOLDER #Please fill in train xml path
Expand All @@ -62,7 +62,7 @@ data:
saturation: [0.8, 1.2]
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
val:
name: xml_dataset
name: XMLDataset
class_names: *class_names
img_path: VAL_IMAGE_FOLDER #Please fill in val image path
ann_path: VAL_XML_FOLDER #Please fill in val xml path
Expand Down
14 changes: 13 additions & 1 deletion nanodet/data/dataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import copy
import warnings

from .coco import CocoDataset
from .xml_dataset import XMLDataset
Expand All @@ -22,8 +23,19 @@ def build_dataset(cfg, mode):
dataset_cfg = copy.deepcopy(cfg)
name = dataset_cfg.pop("name")
if name == "coco":
warnings.warn(
"Dataset name coco has been deprecated. Please use CocoDataset instead."
)
return CocoDataset(mode=mode, **dataset_cfg)
if name == "xml_dataset":
elif name == "xml_dataset":
warnings.warn(
"Dataset name xml_dataset has been deprecated. "
"Please use XMLDataset instead."
)
return XMLDataset(mode=mode, **dataset_cfg)
elif name == "CocoDataset":
return CocoDataset(mode=mode, **dataset_cfg)
elif name == "XMLDataset":
return XMLDataset(mode=mode, **dataset_cfg)
else:
raise NotImplementedError("Unknown dataset type!")

0 comments on commit 73ef835

Please sign in to comment.