Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline for fast, single image prediction #333

Closed
tugot17 opened this issue Aug 17, 2020 · 3 comments
Closed

Pipeline for fast, single image prediction #333

tugot17 opened this issue Aug 17, 2020 · 3 comments
Labels
documentation Improvements or additions to documentation example request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tugot17
Copy link

tugot17 commented Aug 17, 2020

📓 New <Tutorial/Example>

Is this a request for a tutorial or for an example?
Example

What is the task?
How to do a fast prediction for single image

Let say we start with something like

from mantisshrimp.all import *
from PIL import Image

model = faster_rcnn.model(num_classes=5)

model.load_state_dict(torch.load(weights_path, map_location=lambda storage, loc: storage))
model.eval()

img = Image.open(path)

How to add Normalizing transformation and get a prediction without constructing the Parser and Dataset

Is this example for a specific model?
FasterRCNN


Don't remove
Main issue for examples: #39

@tugot17 tugot17 added documentation Improvements or additions to documentation example request good first issue Good for newcomers help wanted Extra attention is needed labels Aug 17, 2020
@lgvaz
Copy link
Collaborator

lgvaz commented Aug 17, 2020

We have a snippet for that, still needs to be converted to a tutorial, check it out here

@tugot17
Copy link
Author

tugot17 commented Aug 18, 2020

Yeah the approach from the example works fine. However it might be useful to add Resize tfms to the transformations list

tfms = tfms.A.Adapter([tfms.A.Resize(384, 384), tfms.A.Normalize()]) So we are sure that the image domain is same

Thanks again for your help :)

@lgvaz
Copy link
Collaborator

lgvaz commented Aug 20, 2020

@tugot17 can this be closed?

@tugot17 tugot17 closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation example request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants