I had some more time to check this out.
I was able to modify the engine.py script to handle pfm files so it can now make masks for DT from SAM2. The code actually should allow for masks in most common file types.
I was not able to elegantly modify the GUI.py to reflect this so I just changed it to PFM for the default file instead of PNG but creating a file with a png extension makes a png, tif for tif etc. I just wast sure how to get the file type dropdown to work.
To achieve this, I just had to add opencv to my python environment for pfm support
So adding opencv manually or to the requirements text and using the code in the gui and engine python scripts as modified by me in the zip file should adapt your code found here…
I was not able using pyinstaller to make an exe file like your smart.exe that would work…if I could then I could likely use the external editor in DT to integrate this or a little at least… Maybe the actions could be ported to lua.
for now python main.py will open your SAM2 viewer/mask creator
I’m a complete novice so the chances of sucess might be slim to none but I might try…anyway thanks again for sharing this as a framework and I just posted here to follow-up with an update…
PFM mask from SAM2.zip (191.0 KB)
EDIT:
The zip file has a sample mask from the playraw image of the elephants at sunset…