Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
300019dd
Unverified
Commit
300019dd
authored
Jan 02, 2020
by
Francisco Massa
Committed by
GitHub
Jan 02, 2020
Browse files
Fix lint following #1695 (#1713)
* Fix lint following #1695 * V2 * V3
parent
06cbdb5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
torchvision/models/detection/faster_rcnn.py
torchvision/models/detection/faster_rcnn.py
+8
-5
No files found.
torchvision/models/detection/faster_rcnn.py
View file @
300019dd
...
@@ -318,16 +318,19 @@ def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,
...
@@ -318,16 +318,19 @@ def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,
Example::
Example::
>>> model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)
>>> 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)
>>> images = list(image for image in images)
>>> targets = []
>>> targets = []
>>> for i in range(len(images)):
>>> for i in range(len(images)):
>>> d = {}
>>> d = {}
>>> d['boxes'] = boxes[i]
>>> d['boxes'] = boxes[i]
>>> d['labels'] = labels[i]
.type(torch.int64)
>>> d['labels'] = labels[i]
>>> targets.append(d)
>>> targets.append(d)
>>> output = model(images,targets)
>>> output = model(images, targets)
>>> model.eval() # For inference
>>> # For inference
>>> model.eval()
>>> x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
>>> x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
>>> predictions = model(x)
>>> predictions = model(x)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment