yolov9 icon indicating copy to clipboard operation
yolov9 copied to clipboard

Yolov9 + SAM ( Meta )

Open Redouxne opened this issue 1 year ago • 8 comments

Hi,

I want to get the bboxes frome Yolov9 with this code which works with Yolov8.

Here is thee code that I use for Yolov8:

from ultralytics import YOLO

model = YOLO('yolov8n.pt')

results = model.predict(source='PATH_TO_IMAGE', conf=0.25)


for result in results:
    boxes = result.xyxy
bbox=boxes.xyxy.tolist()[0]

How can I get the results witth Yolov9 in a way that allow me to implement it with SAM later ?

Redouxne avatar Feb 27 '24 13:02 Redouxne

Ultralytics have not included yolov9 yet..

deepukr007 avatar Feb 27 '24 14:02 deepukr007

You have to check with ultralytics directly They plan to implement a yolov9 model if I don't say something stupid https://docs.ultralytics.com/fr/models/yolov9/#integration-and-future-directions

Youho99 avatar Feb 27 '24 15:02 Youho99

Ultralytics have not included yolov9 yet..

What I wanted was to take the Yolov8 code that I cited and reproduce the box recovery functionality but on Yolov9 and without going through the

from ultralytics import YOLO

model = YOLO('yolov8n.pt')

results = model.predict(source='PATH_TO_IMAGE', conf=0.25)

But adapting this code to the V9 version.

Thanks

Redouxne avatar Feb 27 '24 19:02 Redouxne

@Redouxne Check out my notebook at deepinvalue/yolov9-supervision-tracking-counting. I believe it could be adapted to achieve what you're looking for.

deepinvalue avatar Feb 27 '24 23:02 deepinvalue

Hi @Redouxne, Is this what you are referring to?

model = DetectMultiBackend(weights='path_to_weight', device=device, fuse=True)
results = AutoShape(model(path_to_image))
for det in results.pred[0]:
    bbox = det[:4]
    x1, y1, x2, y2 = map(int, bbox)

You can find more details and context on how to use it on YOLOv9_DeepSORT

sujanshresstha avatar Feb 27 '24 23:02 sujanshresstha

Please don;t worry, I request you to please wait for 24-48 hours, and allow us time to look into it, we will surely get into the best possible resolution.

theankeshh avatar Feb 28 '24 17:02 theankeshh

@Redouxne Check out my notebook at deepinvalue/yolov9-supervision-tracking-counting. I believe it could be adapted to achieve what you're looking for.

It's not working for Live Inference. I think you would call the process_video function to do live inference as;

yolov9_config=dict(conf=0.3, iou=0.45, classes=[0, 2, 3])
process_video(model, config=yolov9_config, counting_zone=None, show_labels=True, source_path=1,
                    target_path='output/otpt_5.mp4')

The code starts running and completes within a second but does nothing. No screen shows up.

MuhammadBilal848 avatar Mar 07 '24 09:03 MuhammadBilal848

are you trying to get the bounding box from the image to be predicted? I think comments from @sujanshresstha should be able to work.

TheMattBin avatar Apr 20 '24 06:04 TheMattBin