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

How to infer on an image? #9

Closed
luckcodingdog opened this issue Jan 31, 2023 · 3 comments
Closed

How to infer on an image? #9

luckcodingdog opened this issue Jan 31, 2023 · 3 comments

Comments

@luckcodingdog
Copy link

Thank you for your great work!
Is there any script to infer on an image with your model?

@jozhang97
Copy link
Owner

Thanks for your interest!
I haven't written one myself but the nice people at HuggingFace (Niels) prepared one here
See this github issue #3

@luckcodingdog
Copy link
Author

luckcodingdog commented Feb 1, 2023

Thanks for your answer.
I have test the same script from Niels' github:
https://github.com/NielsRogge/Transformers-Tutorials/blob/master/DETA/Inference_with_DETA_(ResNet_%2B_Swin_backbones).ipynb
It run on cpu not gpu.
If someone wants to test on gpu, he should add lines like below:
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
inputs = inputs.to(device)

@xinlin-xiao
Copy link

Thanks for your answer. I have test the same script from Niels' github: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/DETA/Inference_with_DETA_(ResNet_%2B_Swin_backbones).ipynb It run on cpu not gpu. If someone wants to test on gpu, he should add lines like below: device = "cuda" if torch.cuda.is_available() else "cpu" model.to(device) inputs = inputs.to(device)

@luckcodingdog Hello, Where can I add these lines:
device = "cuda" if torch.cuda.is_available() else "cpu" model.to(device) inputs = inputs.to(device)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants