Hi and welcome! We don't have an updated version of this at the moment, since it was contributed by a community member and is already a bit older – but if you do end up adapting it, we'd definitely appreciate a PR!
For a newer approach that uses a model via an API (Segment Anything), you might find prodigy-segment useful. It's a slightly different approach with different trade-offs, but more modern: