@@ -99,7 +99,9 @@ def test_assign_targets_to_proposals(self):
99
99
],
100
100
)
101
101
def test_forward_negative_sample_frcnn (self , name ):
102
- model = torchvision .models .detection .__dict__ [name ](num_classes = 2 , min_size = 100 , max_size = 100 )
102
+ model = torchvision .models .detection .__dict__ [name ](
103
+ num_classes = 2 , min_size = 100 , max_size = 100 , pretrained_backbone = False
104
+ )
103
105
104
106
images , targets = self ._make_empty_sample ()
105
107
loss_dict = model (images , targets )
@@ -108,7 +110,9 @@ def test_forward_negative_sample_frcnn(self, name):
108
110
assert_equal (loss_dict ["loss_rpn_box_reg" ], torch .tensor (0.0 ))
109
111
110
112
def test_forward_negative_sample_mrcnn (self ):
111
- model = torchvision .models .detection .maskrcnn_resnet50_fpn (num_classes = 2 , min_size = 100 , max_size = 100 )
113
+ model = torchvision .models .detection .maskrcnn_resnet50_fpn (
114
+ num_classes = 2 , min_size = 100 , max_size = 100 , pretrained_backbone = False
115
+ )
112
116
113
117
images , targets = self ._make_empty_sample (add_masks = True )
114
118
loss_dict = model (images , targets )
@@ -118,7 +122,9 @@ def test_forward_negative_sample_mrcnn(self):
118
122
assert_equal (loss_dict ["loss_mask" ], torch .tensor (0.0 ))
119
123
120
124
def test_forward_negative_sample_krcnn (self ):
121
- model = torchvision .models .detection .keypointrcnn_resnet50_fpn (num_classes = 2 , min_size = 100 , max_size = 100 )
125
+ model = torchvision .models .detection .keypointrcnn_resnet50_fpn (
126
+ num_classes = 2 , min_size = 100 , max_size = 100 , pretrained_backbone = False
127
+ )
122
128
123
129
images , targets = self ._make_empty_sample (add_keypoints = True )
124
130
loss_dict = model (images , targets )
0 commit comments