Unverified Commit 481ef519 authored by Aditya Oke's avatar Aditya Oke Committed by GitHub
Browse files

Adds Anchor tests (#2971)

* tries adding anchor tests

* fixes lint

* tries fixing

* tries one more time

* fixes the test
parent 120f70fe
import torch
import unittest
from torchvision.models.detection.anchor_utils import AnchorGenerator
from torchvision.models.detection.image_list import ImageList
class Tester(unittest.TestCase):
def test_incorrect_anchors(self):
incorrect_sizes = ((2, 4, 8), (32, 8), )
incorrect_aspects = (0.5, 1.0)
anc = AnchorGenerator(incorrect_sizes, incorrect_aspects)
image1 = torch.randn(3, 800, 800)
image_list = ImageList(image1, [(800, 800)])
feature_maps = [torch.randn(1, 50)]
self.assertRaises(ValueError, anc, image_list, feature_maps)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment