Based on https://github.com/jomjol/AI-on-the-edge-device I made a python version with similar functionality to run on a Raspberry Pi (bullseye).
You need OPENCV - Installation information you can find here: https://github.com/Qengineering/Install-OpenCV-Raspberry-Pi-64-bits
You need Tensorflow lite - https://qengineering.eu/install-tensorflow-2-lite-on-raspberry-64-os.html
furthermore paho is needed (sudo pip3 install paho-mqtt)