-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new object detector, Lite-DINO (#2457)
* Initial implementation of Lite DETR * Update model config for lite dino * Add norm to intermediate layer of ffn * Change FFN's norm order and add enc_scale attribute to encoder's layers * Merge with incremental recipe * Add model pretrained weight path * Update model info and add intg tests * Update docs * Update CHANGELOG * Change num iters
- Loading branch information
1 parent
fc6386c
commit 8045480
Showing
13 changed files
with
648 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/otx/algorithms/detection/adapters/mmdet/models/detectors/custom_lite_dino.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""OTX Lite-DINO Class for object detection.""" | ||
|
||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
from mmdet.models.builder import DETECTORS | ||
|
||
from otx.algorithms.common.utils.logger import get_logger | ||
from otx.algorithms.detection.adapters.mmdet.models.detectors import CustomDINO | ||
|
||
logger = get_logger() | ||
|
||
|
||
@DETECTORS.register_module() | ||
class CustomLiteDINO(CustomDINO): | ||
"""Custom Lite-DINO <https://arxiv.org/pdf/2303.07335.pdf> for object detection.""" | ||
|
||
def load_state_dict_pre_hook(self, model_classes, ckpt_classes, ckpt_dict, *args, **kwargs): | ||
"""Modify official lite dino version's weights before weight loading.""" | ||
super(CustomDINO, self).load_state_dict_pre_hook(model_classes, ckpt_classes, ckpt_dict, *args, *kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.