NNstreamer is a good package that runs on top of gstreamer, and adds neural networks into the pipeline.
https://nnstreamer.ai/
I have this running on Yocto, but the configuration isn't generically applicable to ubuntu, and also I need the setup to work with the gstreamer rtsp server configuration. The pipeline gets complicated, so it needs to get staged, and documented.
My first example with this would be simple object classification with yolo5.