Nice, but the choice to implement a resource intensive AI project (CPU/RAM) on Pie in Python is baffling. I could not think of a worse implementation language for a resource constrained environment ¯\_(ツ)_/¯.
Python is only really the glue here. The models are trained in PyTorch and exported to Microsoft's Onnx runtime (C++). So the bulk of the inference CPU cycles are outside Python.