TinyML is an incredibly powerful piece of software, and you can easily train your own model and deploy it on an ESP32.
The advantage of Python is that you can apply operations to larger datasets with hundreds, even thousands, of data points ...