Commit 51c9784 1 parent b3299bd commit 51c9784 Copy full SHA for 51c9784
File tree 2 files changed +3
-2
lines changed
icevision/models/mmdet/common/bbox
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Supports pytorch 1.8
8
8
### Added
9
9
- ` iou_thresholds ` parameter to ` COCOMetric `
10
10
- ` SimpleConfusionMatrix ` Metric
11
+ - Negative samples support for mmdetection object detection models
11
12
12
13
### Changed
13
14
- ** Breaking:** Albumentations ` aug_tfms ` defaults.
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def _img_meta(record):
111
111
112
112
def _labels (record ):
113
113
if len (record .detection .label_ids ) == 0 :
114
- raise RuntimeError ( "Negative samples still needs to be implemented" )
114
+ return torch . empty ( 0 )
115
115
else :
116
116
tensor_label_ids = tensor (record .detection .label_ids )
117
117
labels = convert_background_from_zero_to_last (
@@ -122,7 +122,7 @@ def _labels(record):
122
122
123
123
def _bboxes (record ):
124
124
if len (record .detection .label_ids ) == 0 :
125
- raise RuntimeError ( "Negative samples still needs to be implemented" )
125
+ return torch . empty (( 0 , 4 ) )
126
126
else :
127
127
xyxys = [bbox .xyxy for bbox in record .detection .bboxes ]
128
128
return tensor (xyxys , dtype = torch .float32 )
You can’t perform that action at this time.
0 commit comments