Skip to content

Commit

Permalink
add: mobilenetv4 backbone (#217)
Browse files Browse the repository at this point in the history
* Fix: data type bug

* Optim: model inference display

* Fix: cls loss weight too high

* add: mobilenetv4 backbone
  • Loading branch information
mjq2020 authored May 22, 2024
1 parent 40fd17a commit 343a2cb
Show file tree
Hide file tree
Showing 5 changed files with 1,293 additions and 10 deletions.
16 changes: 13 additions & 3 deletions configs/swift_yolo/base_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,27 @@
),
prior_generator=dict(type='mmdet.YOLOAnchorGenerator', base_sizes=anchors, strides=strides),
# scaled based on number of detection layers
loss_cls=dict(type='mmdet.CrossEntropyLoss', use_sigmoid=True, reduction='mean', loss_weight=loss_cls_weight),
loss_cls=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=loss_cls_weight * (num_classes / 80 * 3 / num_det_layers),
),
loss_bbox=dict(
type='IoULoss',
iou_mode='ciou',
bbox_format='xywh',
eps=1e-7,
reduction='mean',
loss_weight=loss_bbox_weight,
loss_weight=loss_bbox_weight * (3 / num_det_layers),
return_iou=True,
),
loss_obj=dict(type='mmdet.CrossEntropyLoss', use_sigmoid=True, reduction='mean', loss_weight=loss_obj_weight),
loss_obj=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=loss_obj_weight * ((imgsz[0] / 640) ** 2 * 3 / num_det_layers),
),
prior_match_thr=prior_match_thr,
obj_level_weights=obj_level_weights,
),
Expand Down
18 changes: 14 additions & 4 deletions configs/swift_yolo/swift_yolo_labelmatch_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,27 @@
),
prior_generator=dict(type='mmdet.YOLOAnchorGenerator', base_sizes=anchors, strides=strides),
# scaled based on number of detection layers
loss_cls=dict(type='mmdet.CrossEntropyLoss', use_sigmoid=True, reduction='mean', loss_weight=loss_cls_weight),
loss_cls=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=loss_cls_weight * (num_classes / 80 * 3 / num_det_layers),
),
loss_bbox=dict(
type='IoULoss',
iou_mode='ciou',
bbox_format='xywh',
eps=1e-7,
reduction='mean',
loss_weight=loss_bbox_weight,
loss_weight=loss_bbox_weight * (3 / num_det_layers),
return_iou=True,
),
loss_obj=dict(type='mmdet.CrossEntropyLoss', use_sigmoid=True, reduction='mean', loss_weight=loss_obj_weight),
loss_obj=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=loss_obj_weight * ((imgsz[0] / 640) ** 2 * 3 / num_det_layers),
),
prior_match_thr=prior_match_thr,
obj_level_weights=obj_level_weights,
),
Expand Down Expand Up @@ -418,7 +428,7 @@
),
dict(type='mmdet.MeanTeacherHook'),
dict(type="sscma.SemiHook", bure_epoch=200),
dict(type="sscma.LabelMatchHook",priority=100),
dict(type="sscma.LabelMatchHook", priority=100),
]


Expand Down
16 changes: 13 additions & 3 deletions configs/swift_yolo/swift_yolo_mb2_1xb16_300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,27 @@
),
prior_generator=dict(type='mmdet.YOLOAnchorGenerator', base_sizes=anchors, strides=strides),
# scaled based on number of detection layers
loss_cls=dict(type='mmdet.CrossEntropyLoss', use_sigmoid=True, reduction='mean', loss_weight=loss_cls_weight),
loss_cls=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=loss_cls_weight * (num_classes / 80 * 3 / num_det_layers),
),
loss_bbox=dict(
type='IoULoss',
iou_mode='ciou',
bbox_format='xywh',
eps=1e-7,
reduction='mean',
loss_weight=loss_bbox_weight,
loss_weight=loss_bbox_weight * (3 / num_det_layers),
return_iou=True,
),
loss_obj=dict(type='mmdet.CrossEntropyLoss', use_sigmoid=True, reduction='mean', loss_weight=loss_obj_weight),
loss_obj=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=loss_obj_weight * ((imgsz[0] / 640) ** 2 * 3 / num_det_layers),
),
prior_match_thr=prior_match_thr,
obj_level_weights=obj_level_weights,
),
Expand Down
Loading

0 comments on commit 343a2cb

Please sign in to comment.