jsbroks / coco-annotator

:pencil2: Web-based image segmentation tool for object detection, localization, and keypoints
MIT License
2.11k stars 460 forks source link

Will it be possible to integrate SAM here? #597

Open kudaibergenu opened 1 year ago

kudaibergenu commented 1 year ago

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

Best

SixK commented 1 year ago

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 --input --output <path/to/output> So you can actually import json files generated by SAM

SixK commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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