Viewing a single comment thread. View all comments

i_ikhatri t1_j3v7uda wrote

/u/psychorameses was spot on when he said that python is a scripting language. It’s really not meant for you to be able to do this.

The correct answer for this is what /u/robertknight2 suggested. If you want to deploy a production grade application then you need to export your model (either to ONNX, or TFLite or similar). Once you have the exported model you write a GUI application any old way. You can make a QT GUI application that interacts with the ONNX model using the C++ ONNX runtime API. Or you could write an electron application that uses TFJS to run a TFLite model. Both are viable options (though idk if you’ll be able to get TFLite using the GPU easily in Electron).

This is CPU only but here is an example of a C++ windows application that uses the ONNX runtime. Packaging CUDA (TensorRT really) and getting it to work with ONNX should only be a little bit more work. A quick google search yielded this thread for packaging TensorRT into a VS project on windows. It looks like it has a working example too: https://github.com/NVIDIA/TensorRT/issues/2085

1