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 use LibTorch c++ api to do predict from source files #2185

Closed
venividivici666 opened this issue May 15, 2024 · 2 comments
Closed

How to use LibTorch c++ api to do predict from source files #2185

venividivici666 opened this issue May 15, 2024 · 2 comments
Assignees

Comments

@venividivici666
Copy link

Hi all,
I have trained a nnUNet 2d model and how can I use the model and weights like ''example = torch.rand(1, 3, 224, 224); traced_script_module = torch.jit.trace(model, example)" to use LibTorch c++ api to do predict from source files? And the input data needed to do predict seem to need processing, I don't know how to do that? Any suggestions?

Thank you very much!

@caolonghao
Copy link

Same question here! I've exported the trained model into onnx format, but since the input image need to be preprocessed, I have no idea how to do the processing on raw images seperately.

@sten2lu
Copy link
Contributor

sten2lu commented May 18, 2024

Hi @venividivici666 and @caolonghao

First off, I would suggest you to look at the README about Inference
To do the preprocessing on the raw images separately, I suggest you look at the nnUNetPredictor source code.

Also, in issue #2100, a general guideline to deploy nnU-Net was detailed out in case you are interested.

Best regards

@sten2lu sten2lu closed this as completed May 31, 2024
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