Skip to content

Commit

Permalink
Fix lint following #1695 (#1713)
Browse files Browse the repository at this point in the history
* Fix lint following #1695

* V2

* V3
  • Loading branch information
fmassa authored Jan 2, 2020
1 parent 06cbdb5 commit 300019d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions torchvision/models/detection/faster_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,19 @@ def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,
Example::
>>> model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)
>>> images,boxes,labels = torch.rand(4,3,600,1200), torch.rand(4,11,4), torch.rand(4,11) # For Training
>>> # For training
>>> images, boxes = torch.rand(4, 3, 600, 1200), torch.rand(4, 11, 4)
>>> labels = torch.randint(1, 91, (4, 11))
>>> images = list(image for image in images)
>>> targets = []
>>> targets = []
>>> for i in range(len(images)):
>>> d = {}
>>> d['boxes'] = boxes[i]
>>> d['labels'] = labels[i].type(torch.int64)
>>> d['labels'] = labels[i]
>>> targets.append(d)
>>> output = model(images,targets)
>>> model.eval() # For inference
>>> output = model(images, targets)
>>> # For inference
>>> model.eval()
>>> x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
>>> predictions = model(x)
Expand Down

0 comments on commit 300019d

Please sign in to comment.