roboflow / supervision

We write your reusable computer vision tools. šŸ’œ
https://supervision.roboflow.com
MIT License
22.65k stars 1.69k forks source link

yolov5 instance segmentation inference #1284

Open DrawingProcess opened 3 months ago

DrawingProcess commented 3 months ago

Search before asking

Description

yolov5 is a detection and 'instance segmentation' model. so, I think If there is a mask area, I think it should be return.

like below

return cls(
    xyxy=yolov5_detections_predictions[:, :4],
    confidence=yolov5_detections_predictions[:, 4],
    class_id=yolov5_detections_predictions[:, 5].astype(int),
)

Use case

No response

Additional

No response

Are you willing to submit a PR?

LinasKo commented 3 months ago

Hi @DrawingProcess šŸ‘‹

Well spotted. I thought we had it. Still, let me check with the core team and check our stance on this.

Meanwhile, there are things we need to find out first:

  1. Are yolov5 weights for segmentation available in Pytorch Hub. It would make our testing easier.
  2. Can our from_ultralytics method handle yolov5 response? My guess is no.
    • If yolov5 provides a list as a response, we should check both from_ultralytics(results) and from_ultralytics(results[0])
  3. Is segmentation with yolov5 something you need for your project? In 99% of the cases, we'd recommend using yolov8 instead.
Bhavay-2001 commented 3 months ago

Hi @DrawingProcess @LinasKo, can I start working on this if no one is working on this already?

DrawingProcess commented 3 months ago

@Bhavay-2001 Sure. I'll contribute to another part.

LinasKo commented 3 months ago

Hey @Bhavay-2001 , @DrawingProcess ,

I'd like to chat with the core team before starting this one.

Also, @DrawingProcess has priority here as he suggested working on it.

Bhavay-2001 commented 3 months ago

Sure @LinasKo, if @DrawingProcess wants to work on this he can else I would be up to take this issue. Thanks

DrawingProcess commented 3 months ago

@LinasKo If it's confirmed, I'll proceed.

LinasKo commented 3 months ago

@DrawingProcess, confirming half of it. You may start working after I check with @SkalskiP.

DrawingProcess commented 3 months ago

@LinasKo I checked it and I will send you PR after testing it.

LinasKo commented 3 months ago

Hi @DrawingProcess,

I spoke with the core team. It sounds like a useful change and your contribution would be most welcome. šŸ˜‰

Please don't forget to include the Colab, as that speeds up our review process.

Bhavay-2001 commented 2 months ago

Hi @DrawingProcess, are you working on this one?

DrawingProcess commented 2 months ago

Hi, Maybe Iā€™m working at this week.

On Thu, Jul 18, 2024 at 13:26 Bhavay Malhotra @.***> wrote:

Hi @DrawingProcess https://github.com/DrawingProcess, are you working on this one?

ā€” Reply to this email directly, view it on GitHub https://github.com/roboflow/supervision/issues/1284#issuecomment-2235305574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEFPEM7GXTJWD4CVI6HWHDZM47XDAVCNFSM6AAAAABJMT45OGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZVGMYDKNJXGQ . You are receiving this because you were mentioned.Message ID: @.***>

SkalskiP commented 2 months ago

Hi @DrawingProcess šŸ‘‹šŸ» let us know if you need help or are overwhelmed by work. We can reassign this issue if you don't have time.

Bhavay-2001 commented 2 months ago

Hi @SkalskiP, any active issues to work on right now which are needed for the upcoming release?

Also, I asked about adding the REDETR model soo any progress on that one?

Thanks

DrawingProcess commented 1 month ago

I have a little problem about torch.hub.load. I think they are not yet fully supported for PyTorch Hub inference yolov5 seg model.

Here is my colab source. https://colab.research.google.com/drive/1UizExI0Fs4zTSeLzN_UnIECJxn64mQgl?usp=sharing

Screenshot from 2024-08-01 20-17-46

SkalskiP commented 1 month ago

Hi @DrawingProcess, sorry to hear this. Looks like it breaks before you feed model results to supervision. Nothing we can do about it :/