Somthing similar to adobe's rotobrush, python or C++?

I’ve been thinking. How would something similar to adobe’s after effects rotobrush that lets you interactively select an object to rotoscope automatically.

You just paint over what you want and the program uses some sort of algorithm or ML or something. Would be theoretically possible to pull off given the abundance of machine learning libraries in python such as SAM (or one of the related libraries such as FastSAM) or perhaps PyTorch.

The tricky part is getting all the dependencies. Pip would be the way, but where to install it all and make it easy to distribute is another thing to ask. So how would something like this be created using python and the PyPlugs API.

Or maybe do it in C++, but that might introduce another layer of dependency hell.

Extremely new here and far from a python-ologist but I did find this:

Unsure on how to implement this into Natron, but this seems promising.