coco-annotator icon indicating copy to clipboard operation
coco-annotator copied to clipboard

Will it be possible to integrate SAM here?

Open kudaibergenu opened this issue 2 years ago • 4 comments

COCO annotator is great! Would it be possible to integrate a coco annotator tool here?

Best

kudaibergenu avatar Apr 24 '23 10:04 kudaibergenu

For SAM, I think you are talking about Segment Anything Model (SAM) from facebook. https://github.com/facebookresearch/segment-anything It would be clearly a good idea. And it's probably not that difficult to adapt.

Note that SAM is already extracting segmented objects to coco format. python scripts/amg.py --checkpoint <path/to/checkpoint> --model-type <model_type> --input <image_or_folder> --output <path/to/output> So you can actually import json files generated by SAM

SixK avatar Apr 25 '23 12:04 SixK

Just published a Proof Of Concept to use SAM with coco-annotator here : https://github.com/SixK/sam2coco_server

Follow the README.md to use it. Note, that I thought SAM was identifying classes, but it seem's to only generate masks. The command line I provided in my previous message only extract masks images.

SixK avatar Jun 01 '23 07:06 SixK

Created a vue3 version of coco-annotator (still bogus, use it at your own risk), with SAM support added. Difference with sam2coco_server that annotate everything in the picture, simply click SAM button then object you want to annotate and the mask will be created. This version require a Cuda graphic card, you may try to force CPU if needed, but this is untested. https://github.com/SixK/coco-annotator/tree/vue3+sam

Follow README instructions to build images

SixK avatar Jun 07 '23 22:06 SixK

Now use SAM-HQ in place of SAM: https://github.com/SysCV/sam-hq

To test it in coco-annotator, use same link as previous post: https://github.com/SixK/coco-annotator/tree/vue3+sam

SixK avatar Jun 16 '23 21:06 SixK