Acly / krita-ai-tools

Krita plugin which adds selection tools to mask objects with a single click, or by drawing a bounding box.
GNU General Public License v3.0
426 stars 21 forks source link

Segment Anything 2 #23

Open Acly opened 3 months ago

Acly commented 3 months ago

https://github.com/facebookresearch/segment-anything-2

So for precise masks some kind of follow up would still be needed.

No ONNX model out yet.

Rubenacp commented 3 months ago

Would be great

Acly commented 2 months ago

Did some tests with exported ONNX models. They're working fine, but performance wise it would be a big regression.

Model Size Inference time
MobileSAM 43 MB 450 ms
SAM2 Small 179 MB 1240 ms
SAM2 Tiny 151 MB 1000 ms

This is on CPU, which is most common scenario. The masks are mostly the same regarding pixel quality. The detection accuracy is expected to better for SAM2.

A distilled/quantized version of SAM2 model would be interesting...

Rubenacp commented 2 months ago

Thank you, I 'll try it

feffy380 commented 1 month ago

Note: Meta has released updated models (SAM 2.1)