otx.algorithms.detection.adapters.mmdet.models.detectors#
Initial file for mmdetection detectors.
Classes
|
SAM optimizer & L2SP regularizer enabled custom ATSS. |
|
Custom Deformable DETR with task adapt. |
|
Custom Lite-DINO <https://arxiv.org/pdf/2303.07335.pdf> for object detection. |
|
Custom DINO detector. |
|
CustomMaskRCNN Class for mmdetection detectors. |
|
SAM optimizer & L2SP regularizer enabled custom SSD. |
|
SAM optimizer & L2SP regularizer enabled custom 2-stage detector. |
|
SAM optimizer & L2SP regularizer enabled custom VFNet. |
|
SAM optimizer & L2SP regularizer enabled custom YOLOX. |
|
L2SP-enabled detector mix-in. |
SAM-enabled BaseDetector mix-in. |
|
|
Custom MaskRCNN detector with tile classifier. |
|
Mean teacher framework for detection and instance segmentation. |
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomATSS(*args, task_adapt=None, **kwargs)[source]#
Bases:
SAMDetectorMixin
,DetLossDynamicsTrackingMixin
,L2SPDetectorMixin
,ATSS
SAM optimizer & L2SP regularizer enabled custom ATSS.
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomDINO(*args, task_adapt=None, **kwargs)[source]#
Bases:
CustomDeformableDETR
Custom DINO detector.
Initialize BaseModule, inherited from torch.nn.Module
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomDeformableDETR(*args, task_adapt=None, **kwargs)[source]#
Bases:
DeformableDETR
Custom Deformable DETR with task adapt.
Deformable DETR does not support task adapt, so it just take task_adpat argument.
Initialize BaseModule, inherited from torch.nn.Module
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomLiteDINO(*args, task_adapt=None, **kwargs)[source]#
Bases:
CustomDINO
Custom Lite-DINO <https://arxiv.org/pdf/2303.07335.pdf> for object detection.
Initialize BaseModule, inherited from torch.nn.Module
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomMaskRCNN(*args, task_adapt=None, **kwargs)[source]#
Bases:
SAMDetectorMixin
,L2SPDetectorMixin
,MaskRCNN
CustomMaskRCNN Class for mmdetection detectors.
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomMaskRCNNTileOptimized(*args, **kwargs)[source]#
Bases:
CustomMaskRCNN
Custom MaskRCNN detector with tile classifier.
- Parameters:
*args – args
**kwargs – kwargs
- forward_train(img, img_metas, gt_bboxes, gt_labels, gt_bboxes_ignore=None, gt_masks=None, proposals=None, **kwargs)[source]#
Forward pass during training.
Joint training of tile classifier and MaskRCNN.
- Parameters:
img (torch.Tensor) – input image
img_metas (list) – image meta data
gt_bboxes (list) – ground truth bounding boxes
gt_labels (list) – ground truth labels
gt_bboxes_ignore (list, optional) – ground truth bounding boxes to be ignored. Defaults to None.
gt_masks (list, optional) – ground truth masks. Defaults to None.
proposals (list, optional) – proposals. Defaults to None.
kwargs – kwargs
- static make_fake_results(num_classes)[source]#
Make fake results.
- Returns:
MaskRCNN output
- Return type:
- simple_test(img, img_metas, proposals=None, rescale=False, full_res_image=False)[source]#
Simple test.
Tile classifier is used to filter out images without any objects. If no objects are present, empty results are returned. Otherwise, MaskRCNN is used to detect objects.
- Parameters:
- Returns:
MaskRCNN output
- Return type:
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomSingleStageDetector(*args, task_adapt=None, **kwargs)[source]#
Bases:
SAMDetectorMixin
,DetLossDynamicsTrackingMixin
,L2SPDetectorMixin
,SingleStageDetector
SAM optimizer & L2SP regularizer enabled custom SSD.
- forward_train(img, img_metas, gt_bboxes, gt_labels, gt_bboxes_ignore=None, **kwargs)[source]#
Forward function for CustomSSD.
- Parameters:
img (Tensor) – Input images of shape (N, C, H, W). Typically these should be mean centered and std scaled.
img_metas (list[dict]) – A List of image info dict where each dict has: ‘img_shape’, ‘scale_factor’, ‘flip’, and may also contain ‘filename’, ‘ori_shape’, ‘pad_shape’, and ‘img_norm_cfg’. For details on the values of these keys see
mmdet.datasets.pipelines.Collect
.gt_bboxes (list[Tensor]) – Each item are the truth boxes for each image in [tl_x, tl_y, br_x, br_y] format.
gt_labels (list[Tensor]) – Class indices corresponding to each box
gt_bboxes_ignore (None | list[Tensor]) – Specify which bounding boxes can be ignored when computing the loss.
**kwargs (Any) – Addition keyword arguments.
- Returns:
A dictionary of loss components.
- Return type:
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomTwoStageDetector(*args, task_adapt=None, **kwargs)[source]#
Bases:
SAMDetectorMixin
,L2SPDetectorMixin
,TwoStageDetector
SAM optimizer & L2SP regularizer enabled custom 2-stage detector.
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomVFNet(*args, task_adapt=None, **kwargs)[source]#
Bases:
SAMDetectorMixin
,DetLossDynamicsTrackingMixin
,L2SPDetectorMixin
,VFNet
SAM optimizer & L2SP regularizer enabled custom VFNet.
- class otx.algorithms.detection.adapters.mmdet.models.detectors.CustomYOLOX(*args, task_adapt=None, **kwargs)[source]#
Bases:
SAMDetectorMixin
,DetLossDynamicsTrackingMixin
,L2SPDetectorMixin
,YOLOX
SAM optimizer & L2SP regularizer enabled custom YOLOX.
- forward_train(img, img_metas, gt_bboxes, gt_labels, gt_bboxes_ignore=None, **kwargs)[source]#
Forward function for CustomYOLOX.
- class otx.algorithms.detection.adapters.mmdet.models.detectors.L2SPDetectorMixin(l2sp_ckpt=None, l2sp_weight=None, **kwargs)[source]#
Bases:
object
L2SP-enabled detector mix-in.
- class otx.algorithms.detection.adapters.mmdet.models.detectors.MeanTeacher(arch_type, unlabeled_loss_weights={'bbox': 1.0, 'cls': 1.0, 'mask': 1.0}, pseudo_conf_thresh=0.7, bg_loss_weight=-1.0, min_pseudo_label_ratio=0.0, visualize=False, filter_empty_annotations=False, **kwargs)[source]#
Bases:
SAMDetectorMixin
,BaseDetector
Mean teacher framework for detection and instance segmentation.
- forward_teacher(img, img_metas)[source]#
Method to extract predictions (pseudo labeles) from teacher.
- forward_train(img, img_metas, img0=None, gt_bboxes=None, gt_labels=None, gt_masks=None, gt_bboxes_ignore=None, **kwargs)[source]#
Forward function for UnbiasedTeacher.
- generate_pseudo_labels(teacher_outputs, img_meta, **kwargs)[source]#
Generate pseudo label for UnbiasedTeacher.