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

Preloading model for faster inference in python script? #340

Open
TjorvenVD opened this issue Oct 17, 2022 · 0 comments
Open

Preloading model for faster inference in python script? #340

TjorvenVD opened this issue Oct 17, 2022 · 0 comments

Comments

@TjorvenVD
Copy link

Hello there,

We currently trained a model with rotated bounded boxes and are getting pretty good results from it, we trained/evaluated/tested this on our ubuntu machine using the terminal/otdk commands.

We now want to implement this model in our python script that is controlling our robot. The only way we managed to get this to work is opening a docker container trough our python script and sending the same "otdk infer command" using os.system("").

The problem with this method is that we have to put a time.sleep of 10 seconds after this command otherwise our detections.json file is still giving old detections because the inference was not completed yet. The inference itself is pretty fast but the initial loading of the model takes 7-8seconds. Because we are only doing detections on 1 image each 2 - 3min we always have to load the model again for each picture and are loosing a lot of time just waiting before the model is loaded.

What would be the best way to solve this loading time? Is it possible to preload the model somehow so we can just send a picture to it, or are their other solutions for this?

Kind regards,
Tjörven

@TjorvenVD TjorvenVD changed the title Preloading model for faster inference? Preloading model for faster inference in python script? Oct 17, 2022
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

1 participant