roboflow / supervision

We write your reusable computer vision tools. 💜
https://supervision.roboflow.com
MIT License
23.92k stars 1.79k forks source link

[KeypointsDataset] - create a new dataset format to load keypoints #1438

Open SkalskiP opened 2 months ago

SkalskiP commented 2 months ago

Description

Supervision can currently load object detection, instance segmentation, and classification datasets. Let's add the ability to handle keypoint datasets. The sv.KeypointDataset should offer the same functionalities as sv.DetectionDataset and sv.ClassificationDataset, including merge, split, __getitem__, __iter__, from_yolo, and as_yolo.

Additional

shaddu commented 2 months ago

Hi @SkalskiP 👋

I was analyzing the issue and understood that KeypointsDataset will be similar to DetectionDataset, with the difference being the type of annotations.

classes: List[str],
images: Union[List[str], Dict[str, np.ndarray]],
annotations: Dict[str, KeyPoints]

If this is a correct understanding then I will like to work on this issue.

LinasKo commented 2 months ago

Let's only implement the new, lazy-loaded, non-deprecated API, with images: List[str]. This will save work in the future.

LinasKo commented 2 months ago

@shaddu, I also made this template, which should help with starting your colab: Colab Template. Feel free to use as much or as little of it as you wish 😉

shaddu commented 2 months ago

Hi @LinasKo 👋

I also noticed the deprecated warning in the Datasets classes, and the clarification around images: List[str] is helpful.

Thank you for sharing the Colab template 😎 . It will be helpful, and I will suggest adding some similar Colab templates to the contribution guide.