(self)
| 43 | self.model = get_model_zoo("COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml") |
| 44 | |
| 45 | def test_flop(self): |
| 46 | # Faster R-CNN supports flop-counting with random inputs |
| 47 | inputs = [{"image": torch.rand(3, 800, 800)}] |
| 48 | res = flop_count_operators(self.model, inputs) |
| 49 | |
| 50 | # This only checks flops for backbone & proposal generator |
| 51 | # Flops for box head is not conv, and depends on #proposals, which is |
| 52 | # almost 0 for random inputs. |
| 53 | self.assertTrue(int(res["conv"]), 117) |
| 54 | |
| 55 | def test_param_count(self): |
| 56 | res = parameter_count(self.model) |
nothing calls this directly
no test coverage detected