Skip to content

Commit 01a2f2e

Browse files
committed
update TorchvisionDetectorAdaptor: register as usable model
1 parent 45715db commit 01a2f2e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

dlclive/pose_estimation_pytorch/models/detectors/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
DETECTORS,
1313
BaseDetector,
1414
)
15+
from dlclive.pose_estimation_pytorch.models.detectors.torchvision import (
16+
TorchvisionDetectorAdaptor,
17+
)
1518
from dlclive.pose_estimation_pytorch.models.detectors.fasterRCNN import FasterRCNN
1619
from dlclive.pose_estimation_pytorch.models.detectors.ssd import SSDLite

dlclive/pose_estimation_pytorch/models/detectors/torchvision.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import torch
1515
import torchvision.models.detection as detection
1616

17-
from dlclive.pose_estimation_pytorch.models.detectors.base import BaseDetector
17+
from dlclive.pose_estimation_pytorch.models.detectors.base import DETECTORS, BaseDetector
1818

1919

20+
@DETECTORS.register_module
2021
class TorchvisionDetectorAdaptor(BaseDetector):
2122
"""An adaptor for torchvision detectors
2223
@@ -26,8 +27,8 @@ class TorchvisionDetectorAdaptor(BaseDetector):
2627
- fasterrcnn_mobilenet_v3_large_fpn
2728
- fasterrcnn_resnet50_fpn_v2
2829
29-
This class should not be used out-of-the-box. Subclasses (such as FasterRCNN or
30-
SSDLite) should be used instead.
30+
This class can be used directly (e.g. with pre-trained COCO weights) or through its
31+
subclasses (FasterRCNN or SSDLite) which adapt the model for DLC's 2-class detection.
3132
3233
The torchvision implementation does not allow to get both predictions and losses
3334
with a single forward pass. Therefore, during evaluation only bounding box metrics

0 commit comments

Comments
 (0)