An automated application of the entire parametric range against a sample would in itself be useful. Many years ago I used a similar technique to select specific values from satellite RGB data. We refined the result by having an add and a reduce capability along with secondary area selection.
So much of the work is really already done with dt. This is really not an ‘AI’ situation … much/most of the work is already fully implemented.
An automated creation of DT masks would indeed be useful. A Lua script could be the glue between the applications. Take the shapes generated by SAM and convert them to DT mask’s.
I found the DT database table that contains the masks, but the shapes itself are binary blobs? A quick look at the Lua API didn’t reveal any function to access or create the mask’s. Maybe a developer knows more?
the darktable masks are defined by vector shapes or image content based parameters.
Unless SAM output is a kind of a vector shape there’s no way to convert them to dt since dt masks aren’t pixel based