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

Add OpenVINO model inference when models are run on CPU #72

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

surajpaib
Copy link

Following up here on some of the work I did at PW41 (https://projectweek.na-mic.org/PW41_2024_MIT/Projects/IntegrateCpuFriendlyAutoSegmentationAndCtUtilityModelsIntoMhub/)

The main idea would be to provide OpenVINO optimized models for each of the trained models provided in this repo. When run on CPU, these models would be fetched (which are half the size) and optimized inference would be run with the OpenVINO inference API.

Sending this PR in early so we can discuss how to best integrate this.

What I've done so far is:

  1. Take every model url from Models.json and convert the model.pt to an OpenVINO model.xml and model.bin. These are for now repackaged among the zip files and hosted on my fork here: https://github.com/surajpaib/SlicerMONAIAuto3DSeg/releases/Models The conversion script is rather simple and could be added to a Github action or so if needed. https://gist.github.com/surajpaib/74600da3c2ad4e983f4d5022301bf568

  2. I've edited the inference script in the Slicer extension and run the OpenVINO inference using these models (code changes in the PR)

  3. Ran the testing suite from the slicer extension (disabling the GPU). You can see the results here: https://github.com/surajpaib/SlicerMONAIAuto3DSeg/releases/ModelsTestResults
    These might not be one to one comparisons with the previous (as I use a different CPU) so maybe these need to be re-run on the machine used for the original benchmark. On my machine, I see a speedup of between 1.5x to 2x. You can refer to the PW page where I put up some comparisons.

@surajpaib surajpaib marked this pull request as ready for review July 23, 2024 15:42
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

Successfully merging this pull request may close these issues.

1 participant