kadirnar / segment-anything-video

MetaSeg: Packaged version of the Segment Anything repository
Apache License 2.0
946 stars 67 forks source link

how to get more objects like segment anything online demo? #98

Closed zouxiaodong closed 10 months ago

zouxiaodong commented 10 months ago

the image has a high resolution : 5472x3648 How can we achieve a similar detection performance as the online demo for detecting numerous small targets, while using SAM+YOLOV8 that currently detects only a few targets

pests

https://segment-anything.com/demo result : got lot of objects image

-----------sam+yolov8-seg image

from metaseg import SahiAutoSegmentation, sahi_sliced_predict

image_path = "pests.jpg" boxes = sahi_sliced_predict( image_path=image_path, detection_model_type="yolov8", # yolov8, detectron2, mmdetection, torchvision detection_model_path="yolov8x-seg.pt", conf_th=0.25, image_size=1024, slice_height=256, slice_width=256, overlap_height_ratio=0.2, overlap_width_ratio=0.2, )

SahiAutoSegmentation().image_predict( source=image_path, model_type="vit_b", input_box=boxes, multimask_output=False, random_color=False, show=True, save=False, )

kadirnar commented 10 months ago

Does SAHI algorithm support yolov8 segmentation model? I think no. This repo uses Sam's detection results and performs segmentation.

zouxiaodong commented 10 months ago

sorry,I made a mistake, yolov8 only outputs boxes.In my usage scenario, boxes only need to pass the size of the image. tks