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
2a174229
"tests/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "50c255bc2d3feac171bbee4bc68fcd4641a8b68a"
Commit
2a174229
authored
Jan 02, 2020
by
Prajjwal Bhargava
Committed by
Francisco Massa
Jan 02, 2020
Browse files
Added Training Sample code for fasterrcnn_resnet50_fpn (#1695)
parent
d2c763e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
torchvision/models/detection/faster_rcnn.py
torchvision/models/detection/faster_rcnn.py
+10
-1
No files found.
torchvision/models/detection/faster_rcnn.py
View file @
2a174229
...
@@ -318,7 +318,16 @@ def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,
...
@@ -318,7 +318,16 @@ 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)
>>> model.eval()
>>> images,boxes,labels = torch.rand(4,3,600,1200), torch.rand(4,11,4), torch.rand(4,11) # For Training
>>> images = list(image for image in images)
>>> targets = []
>>> for i in range(len(images)):
>>> d = {}
>>> d['boxes'] = boxes[i]
>>> d['labels'] = labels[i].type(torch.int64)
>>> targets.append(d)
>>> output = model(images,targets)
>>> model.eval() # For inference
>>> 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