I have a python application which uses subprocesses to run a bash script. The bash script in turn runs a python file which has some imports (retina face, deep face libraries). The application takes a lot of time to run because each time the subprocess is run, it takes 20-30 secs to load/import retina/deep face modules. Is there a way by which this can be sped up?
Note: Changing the set-up is not possible i.e. I can’t call the python code directly from the original python code.
I am unsure on how to go about solving this, any help is appreciated. Thank you.
I tried using cached version of sys modules but that did not work. Although, I am unsure on how to correctly utilize it.