I have a bunch of Python code with a lot of dependencies (pytorch, opencv, etc.) that I want to use in a Unity application that can be deployed on both PCs and mobile devices. After a lot of research, I found that the most painless way seems to be compiling my code into a shared library for the Unity application to call. However, I don't know what is the best way to do it.
One way that I've been considering has been embedding Python into C++, and then compile it into a shared library. But according to what I've tried so far I still need to have the Python code around for the C++ library to call. That would be quite difficult considering the number of dependencies (the app is to be deployed onto mobile devices).
I wonder if there is a way to compile my Python code into a standalone shared library that can be called in a Unity application?