Skip to content

Commit

Permalink
Update 🔥 quick start section in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SkalskiP authored Dec 4, 2023
1 parent fe9b422 commit b69eea4
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ Read more about desktop, headless, and local installation in our [guide](https:/
Supervision was designed to be model agnostic. Just plug in any classification, detection, or segmentation model. For your convenience, we have created [connectors](https://supervision.roboflow.com/detection/core/#detections) for the most popular libraries like Ultralytics, Transformers, or MMDetection.

```python
>>> import cv2
>>> import supervision as sv
>>> from ultralytics import YOLO

>>> image = cv2.imread(...)
>>> model = YOLO('yolov8s.pt')
>>> result = model(IMAGE)[0]
>>> result = model(image)[0]
>>> detections = sv.Detections.from_ultralytics(result)

>>> len(detections)
Expand All @@ -62,13 +64,14 @@ Supervision was designed to be model agnostic. Just plug in any classification,
Supervision offers a wide range of highly customizable [annotators](https://supervision.roboflow.com/annotators/), allowing you to compose the perfect visualization for your use case.

```python
>>> import cv2
>>> import supervision as sv

>>> image = ...
>>> image = cv2.imread(...)
>>> detections = sv.Detections(...)

>>> mask_annotator = sv.MaskAnnotator()
>>> annotated_frame = mask_annotator.annotate(
>>> bounding_box_annotator = sv.BoundingBoxAnnotator()
>>> annotated_frame = bounding_box_annotator.annotate(
... scene=image.copy(),
... detections=detections
... )
Expand All @@ -84,9 +87,9 @@ Supervision provides a set of [utils](https://supervision.roboflow.com/datasets/
>>> import supervision as sv

>>> dataset = sv.DetectionDataset.from_yolo(
... images_directory_path='...',
... annotations_directory_path='...',
... data_yaml_path='...'
... images_directory_path=...,
... annotations_directory_path=...,
... data_yaml_path=...
... )

>>> dataset.classes
Expand All @@ -103,19 +106,19 @@ Supervision provides a set of [utils](https://supervision.roboflow.com/datasets/

```python
>>> dataset = sv.DetectionDataset.from_yolo(
... images_directory_path='...',
... annotations_directory_path='...',
... data_yaml_path='...'
... images_directory_path=...,
... annotations_directory_path=...,
... data_yaml_path=...
... )

>>> dataset = sv.DetectionDataset.from_pascal_voc(
... images_directory_path='...',
... annotations_directory_path='...'
... images_directory_path=...,
... annotations_directory_path=...
... )

>>> dataset = sv.DetectionDataset.from_coco(
... images_directory_path='...',
... annotations_path='...'
... images_directory_path=...,
... annotations_path=...
... )
```

Expand Down Expand Up @@ -155,32 +158,32 @@ Supervision provides a set of [utils](https://supervision.roboflow.com/datasets/

```python
>>> dataset.as_yolo(
... images_directory_path='...',
... annotations_directory_path='...',
... data_yaml_path='...'
... images_directory_path=...,
... annotations_directory_path=...,
... data_yaml_path=...
... )

>>> dataset.as_pascal_voc(
... images_directory_path='...',
... annotations_directory_path='...'
... images_directory_path=...,
... annotations_directory_path=...
... )

>>> dataset.as_coco(
... images_directory_path='...',
... annotations_path='...'
... images_directory_path=...,
... annotations_path=...
... )
```

- convert

```python
>>> sv.DetectionDataset.from_yolo(
... images_directory_path='...',
... annotations_directory_path='...',
... data_yaml_path='...'
... images_directory_path=...,
... annotations_directory_path=...,
... data_yaml_path=...
... ).as_pascal_voc(
... images_directory_path='...',
... annotations_directory_path='...'
... images_directory_path=...,
... annotations_directory_path=...
... )
```

Expand Down

0 comments on commit b69eea4

Please sign in to comment.