superiorvision 0.30.0.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- superiorvision-0.30.0.dev0/LICENSE.md +9 -0
- superiorvision-0.30.0.dev0/PKG-INFO +398 -0
- superiorvision-0.30.0.dev0/README.md +347 -0
- superiorvision-0.30.0.dev0/pyproject.toml +212 -0
- superiorvision-0.30.0.dev0/setup.cfg +4 -0
- superiorvision-0.30.0.dev0/src/superiorvision/__init__.py +19 -0
- superiorvision-0.30.0.dev0/src/superiorvision.egg-info/PKG-INFO +398 -0
- superiorvision-0.30.0.dev0/src/superiorvision.egg-info/SOURCES.txt +101 -0
- superiorvision-0.30.0.dev0/src/superiorvision.egg-info/dependency_links.txt +1 -0
- superiorvision-0.30.0.dev0/src/superiorvision.egg-info/requires.txt +17 -0
- superiorvision-0.30.0.dev0/src/superiorvision.egg-info/top_level.txt +2 -0
- superiorvision-0.30.0.dev0/src/supervision/__init__.py +318 -0
- superiorvision-0.30.0.dev0/src/supervision/annotators/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/annotators/base.py +21 -0
- superiorvision-0.30.0.dev0/src/supervision/annotators/core.py +3551 -0
- superiorvision-0.30.0.dev0/src/supervision/annotators/utils.py +541 -0
- superiorvision-0.30.0.dev0/src/supervision/assets/__init__.py +4 -0
- superiorvision-0.30.0.dev0/src/supervision/assets/downloader.py +166 -0
- superiorvision-0.30.0.dev0/src/supervision/assets/list.py +84 -0
- superiorvision-0.30.0.dev0/src/supervision/classification/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/classification/core.py +216 -0
- superiorvision-0.30.0.dev0/src/supervision/config.py +13 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/core.py +1313 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/formats/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/formats/coco.py +708 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/formats/createml.py +331 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/formats/labelme.py +405 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/formats/pascal_voc.py +449 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/formats/yolo.py +502 -0
- superiorvision-0.30.0.dev0/src/supervision/dataset/utils.py +265 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/compact_mask.py +1927 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/core.py +3864 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/line_zone.py +924 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/overlap_filter.py +426 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tensor_utils.py +1596 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tensor_views.py +48 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/csv_sink.py +242 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/inference_slicer.py +776 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/json_sink.py +215 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/polygon_zone.py +266 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/smoother.py +218 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/tools/transformers.py +265 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/__init__.py +12 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/_typing.py +11 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/boxes.py +510 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/converters.py +830 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/internal.py +806 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/iou_and_nms.py +1606 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/masks.py +625 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/polygons.py +128 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/utils/vlms.py +97 -0
- superiorvision-0.30.0.dev0/src/supervision/detection/vlm.py +945 -0
- superiorvision-0.30.0.dev0/src/supervision/draw/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/draw/base.py +14 -0
- superiorvision-0.30.0.dev0/src/supervision/draw/color.py +598 -0
- superiorvision-0.30.0.dev0/src/supervision/draw/utils.py +527 -0
- superiorvision-0.30.0.dev0/src/supervision/geometry/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/geometry/core.py +208 -0
- superiorvision-0.30.0.dev0/src/supervision/geometry/utils.py +54 -0
- superiorvision-0.30.0.dev0/src/supervision/key_points/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/key_points/annotators.py +997 -0
- superiorvision-0.30.0.dev0/src/supervision/key_points/core.py +1506 -0
- superiorvision-0.30.0.dev0/src/supervision/key_points/skeletons.py +2646 -0
- superiorvision-0.30.0.dev0/src/supervision/keypoint/__init__.py +13 -0
- superiorvision-0.30.0.dev0/src/supervision/keypoint/annotators.py +13 -0
- superiorvision-0.30.0.dev0/src/supervision/keypoint/core.py +8 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/__init__.py +40 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/core.py +74 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/detection.py +1632 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/f1_score.py +815 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/mean_average_precision.py +1723 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/mean_average_recall.py +734 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/precision.py +815 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/recall.py +774 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/utils/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/utils/matching.py +56 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/utils/object_size.py +256 -0
- superiorvision-0.30.0.dev0/src/supervision/metrics/utils/utils.py +9 -0
- superiorvision-0.30.0.dev0/src/supervision/py.typed +0 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/__init__.py +5 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/byte_tracker/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/byte_tracker/core.py +448 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/byte_tracker/kalman_filter.py +186 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/byte_tracker/matching.py +211 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/byte_tracker/single_object_track.py +194 -0
- superiorvision-0.30.0.dev0/src/supervision/tracker/byte_tracker/utils.py +34 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/__init__.py +0 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/conversion.py +223 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/deprecate.py +54 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/file.py +209 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/image.py +988 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/internal.py +209 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/iterables.py +103 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/logger.py +61 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/notebook.py +124 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/tensor.py +362 -0
- superiorvision-0.30.0.dev0/src/supervision/utils/video.py +533 -0
- superiorvision-0.30.0.dev0/src/supervision/validators/__init__.py +379 -0
- superiorvision-0.30.0.dev0/tests/test_public_api.py +34 -0
- superiorvision-0.30.0.dev0/tests/test_validate_deprecations.py +152 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Roboflow
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: superiorvision
|
|
3
|
+
Version: 0.30.0.dev0
|
|
4
|
+
Summary: A tensor-native, inference-focused fork of Supervision
|
|
5
|
+
Author-email: "Roboflow et al." <develop@roboflow.com>
|
|
6
|
+
Maintainer-email: Piotr Skalski <piotr@roboflow.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Documentation, https://supervision.roboflow.com/latest/
|
|
9
|
+
Project-URL: Homepage, https://github.com/roboflow/supervision
|
|
10
|
+
Project-URL: Repository, https://github.com/roboflow/supervision
|
|
11
|
+
Keywords: AI,deep-learning,DL,machine-learning,ML,Roboflow,vision
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
26
|
+
Classifier: Topic :: Multimedia :: Video
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
30
|
+
Classifier: Topic :: Software Development
|
|
31
|
+
Classifier: Typing :: Typed
|
|
32
|
+
Requires-Python: >=3.10
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
License-File: LICENSE.md
|
|
35
|
+
Requires-Dist: defusedxml>=0.7.1
|
|
36
|
+
Requires-Dist: matplotlib>=3.6
|
|
37
|
+
Requires-Dist: numpy>=1.21.2
|
|
38
|
+
Requires-Dist: opencv-python>=4.5.5.64
|
|
39
|
+
Requires-Dist: pillow>=9.4
|
|
40
|
+
Requires-Dist: pydeprecate<0.11,>=0.9
|
|
41
|
+
Requires-Dist: pyyaml>=5.3
|
|
42
|
+
Requires-Dist: requests>=2.26
|
|
43
|
+
Requires-Dist: scipy>=1.10
|
|
44
|
+
Requires-Dist: torch<3,>=2
|
|
45
|
+
Requires-Dist: tqdm>=4.62.3
|
|
46
|
+
Provides-Extra: geotiff
|
|
47
|
+
Requires-Dist: rasterio>=1.3; extra == "geotiff"
|
|
48
|
+
Provides-Extra: metrics
|
|
49
|
+
Requires-Dist: pandas>=2; extra == "metrics"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
<div align="center">
|
|
53
|
+
<p>
|
|
54
|
+
<a align="center" href="https://supervision.roboflow.com" target="_blank">
|
|
55
|
+
<img
|
|
56
|
+
width="100%"
|
|
57
|
+
src="https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png?updatedAt=1678995927529"
|
|
58
|
+
>
|
|
59
|
+
</a>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
> Supervision, except the numbers have finally been informed that GPUs exist.
|
|
63
|
+
|
|
64
|
+
SuperiorVision is Roboflow's tensor-native, inference-focused fork of
|
|
65
|
+
[Supervision](https://github.com/roboflow/supervision). It preserves the
|
|
66
|
+
`import supervision as sv` API used by
|
|
67
|
+
[Roboflow Inference](https://github.com/roboflow/inference), while keeping
|
|
68
|
+
rectangular numeric state in `torch.Tensor` objects throughout the supported
|
|
69
|
+
code paths.
|
|
70
|
+
|
|
71
|
+
If detections begin as tensors, converting them to NumPy so the next operation
|
|
72
|
+
can turn them back into tensors is not "compatibility." It is cardio.
|
|
73
|
+
SuperiorVision declines the workout.
|
|
74
|
+
|
|
75
|
+
[](https://badge.fury.io/py/supervision) [](https://pypistats.org/packages/supervision) [](LICENSE.md) [](https://badge.fury.io/py/supervision) [](https://codecov.io/gh/roboflow/supervision)
|
|
76
|
+
|
|
77
|
+
[](https://snyk.io/advisor/python/supervision) [](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb) [](https://huggingface.co/spaces/Roboflow/Annotators) [](https://discord.gg/GbfgXGJ8Bk)
|
|
78
|
+
|
|
79
|
+
<div align="center">
|
|
80
|
+
<a href="https://trendshift.io/repositories/124" target="_blank"><img src="https://trendshift.io/api/badge/repositories/124" alt="roboflow%2Fsupervision | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
Same API. Fewer NumPy vacations.
|
|
84
|
+
|
|
85
|
+
For the external multi-object trackers used by Inference, pair SuperiorVision
|
|
86
|
+
with the private [Tracktors](https://github.com/roboflow/tracktors) fork. The
|
|
87
|
+
dependency points one way—Tracktors consumes tensor-native `sv.Detections`—so
|
|
88
|
+
SuperiorVision keeps its existing `sv.ByteTrack` compatibility API without a
|
|
89
|
+
circular package dependency.
|
|
90
|
+
|
|
91
|
+
<details>
|
|
92
|
+
<summary><strong>📑 Table of Contents</strong></summary>
|
|
93
|
+
|
|
94
|
+
- [👋 Hello](#-hello)
|
|
95
|
+
- [💻 Install](#-install)
|
|
96
|
+
- [🔥 Quickstart](#-quickstart)
|
|
97
|
+
- [Models](#models)
|
|
98
|
+
- [Annotators](#annotators)
|
|
99
|
+
- [Datasets](#datasets)
|
|
100
|
+
- [🎬 Tutorials](#-tutorials)
|
|
101
|
+
- [💜 Built with Supervision](#-built-with-supervision)
|
|
102
|
+
- [📚 Documentation](#-documentation)
|
|
103
|
+
- [🏆 Contribution](#-contribution)
|
|
104
|
+
|
|
105
|
+
</details>
|
|
106
|
+
|
|
107
|
+
## 👋 Hello
|
|
108
|
+
|
|
109
|
+
**We are your essential toolkit for computer vision.** From data loading to real-time zone counting, we provide the building blocks so you can focus on building applications around your models. 🤝
|
|
110
|
+
|
|
111
|
+
## 💻 Install
|
|
112
|
+
|
|
113
|
+
Pip install the supervision package in a [**Python>=3.10**](https://www.python.org/) environment.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git clone git@github.com:roboflow/superiorvision.git
|
|
117
|
+
cd superiorvision
|
|
118
|
+
pip install -e .
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Both imports are supported:
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
import supervision as sv # existing Inference code
|
|
125
|
+
import superiorvision as sv # cheekier spelling, same API
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Because SuperiorVision provides the `supervision` namespace, install it as a
|
|
129
|
+
replacement for upstream Supervision, not beside it. Two packages cannot both
|
|
130
|
+
own the same trench coat and pretend everything is fine.
|
|
131
|
+
|
|
132
|
+
The upstream documentation below remains useful for the compatible API surface.
|
|
133
|
+
|
|
134
|
+
## 🔥 Quickstart
|
|
135
|
+
|
|
136
|
+
### Models
|
|
137
|
+
|
|
138
|
+
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/latest/detection/core/#detections) for the most popular libraries like Ultralytics, Transformers, MMDetection, or Inference. Other integrations, like `rfdetr`, already return `sv.Detections` directly.
|
|
139
|
+
|
|
140
|
+
Install the optional dependencies for this example with `pip install pillow rfdetr`.
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
import supervision as sv
|
|
144
|
+
from PIL import Image
|
|
145
|
+
from rfdetr import RFDETRSmall
|
|
146
|
+
|
|
147
|
+
image = Image.open("path/to/image.jpg")
|
|
148
|
+
model = RFDETRSmall()
|
|
149
|
+
detections = model.predict(image, threshold=0.5)
|
|
150
|
+
|
|
151
|
+
len(detections)
|
|
152
|
+
# 5
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
<details>
|
|
156
|
+
<summary>👉 more model connectors</summary>
|
|
157
|
+
|
|
158
|
+
- inference
|
|
159
|
+
|
|
160
|
+
Running with [Inference](https://github.com/roboflow/inference) requires a [Roboflow API KEY](https://docs.roboflow.com/api-reference/authentication#retrieve-an-api-key).
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
import supervision as sv
|
|
164
|
+
from PIL import Image
|
|
165
|
+
from inference import get_model
|
|
166
|
+
|
|
167
|
+
image = Image.open("path/to/image.jpg")
|
|
168
|
+
model = get_model(model_id="rfdetr-small", api_key="ROBOFLOW_API_KEY")
|
|
169
|
+
result = model.infer(image)[0]
|
|
170
|
+
detections = sv.Detections.from_inference(result)
|
|
171
|
+
|
|
172
|
+
len(detections)
|
|
173
|
+
# 5
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
### Annotators
|
|
179
|
+
|
|
180
|
+
Supervision offers a wide range of highly customizable [annotators](https://supervision.roboflow.com/latest/detection/annotators/), allowing you to compose the perfect visualization for your use case.
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
import cv2
|
|
184
|
+
import supervision as sv
|
|
185
|
+
|
|
186
|
+
image = cv2.imread("path/to/image.jpg")
|
|
187
|
+
# Assuming detections are obtained from a model
|
|
188
|
+
detections = sv.Detections(...)
|
|
189
|
+
|
|
190
|
+
box_annotator = sv.BoxAnnotator()
|
|
191
|
+
annotated_frame = box_annotator.annotate(scene=image.copy(), detections=detections)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
https://github.com/roboflow/supervision/assets/26109316/691e219c-0565-4403-9218-ab5644f39bce
|
|
195
|
+
|
|
196
|
+
### Datasets
|
|
197
|
+
|
|
198
|
+
Supervision provides a set of [utils](https://supervision.roboflow.com/latest/datasets/core/) that allow you to load, split, merge, and save datasets in one of the supported formats.
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
import supervision as sv
|
|
202
|
+
from roboflow import Roboflow
|
|
203
|
+
|
|
204
|
+
project = Roboflow().workspace("WORKSPACE_ID").project("PROJECT_ID")
|
|
205
|
+
dataset = project.version("PROJECT_VERSION").download("coco")
|
|
206
|
+
|
|
207
|
+
ds = sv.DetectionDataset.from_coco(
|
|
208
|
+
images_directory_path=f"{dataset.location}/train",
|
|
209
|
+
annotations_path=f"{dataset.location}/train/_annotations.coco.json",
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
path, image, annotation = ds[0]
|
|
213
|
+
# loads image on demand
|
|
214
|
+
|
|
215
|
+
for path, image, annotation in ds:
|
|
216
|
+
# loads image on demand
|
|
217
|
+
pass
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
<details>
|
|
221
|
+
<summary>👉 more dataset utils</summary>
|
|
222
|
+
|
|
223
|
+
- load
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
dataset = sv.DetectionDataset.from_yolo(
|
|
227
|
+
images_directory_path=...,
|
|
228
|
+
annotations_directory_path=...,
|
|
229
|
+
data_yaml_path=...,
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
dataset = sv.DetectionDataset.from_pascal_voc(
|
|
233
|
+
images_directory_path=...,
|
|
234
|
+
annotations_directory_path=...,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
dataset = sv.DetectionDataset.from_coco(
|
|
238
|
+
images_directory_path=...,
|
|
239
|
+
annotations_path=...,
|
|
240
|
+
)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- split
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
train_dataset, test_dataset = dataset.split(split_ratio=0.7)
|
|
247
|
+
test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5)
|
|
248
|
+
|
|
249
|
+
len(train_dataset), len(test_dataset), len(valid_dataset)
|
|
250
|
+
# (700, 150, 150)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- merge
|
|
254
|
+
|
|
255
|
+
```python
|
|
256
|
+
ds_1 = sv.DetectionDataset(...)
|
|
257
|
+
len(ds_1)
|
|
258
|
+
# 100
|
|
259
|
+
ds_1.classes
|
|
260
|
+
# ['dog', 'person']
|
|
261
|
+
|
|
262
|
+
ds_2 = sv.DetectionDataset(...)
|
|
263
|
+
len(ds_2)
|
|
264
|
+
# 200
|
|
265
|
+
ds_2.classes
|
|
266
|
+
# ['cat']
|
|
267
|
+
|
|
268
|
+
ds_merged = sv.DetectionDataset.merge([ds_1, ds_2])
|
|
269
|
+
len(ds_merged)
|
|
270
|
+
# 300
|
|
271
|
+
ds_merged.classes
|
|
272
|
+
# ['cat', 'dog', 'person']
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
- save
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
dataset.as_yolo(
|
|
279
|
+
images_directory_path=...,
|
|
280
|
+
annotations_directory_path=...,
|
|
281
|
+
data_yaml_path=...,
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
dataset.as_pascal_voc(
|
|
285
|
+
images_directory_path=...,
|
|
286
|
+
annotations_directory_path=...,
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
dataset.as_coco(
|
|
290
|
+
images_directory_path=...,
|
|
291
|
+
annotations_path=...,
|
|
292
|
+
)
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
- convert
|
|
296
|
+
|
|
297
|
+
```python
|
|
298
|
+
sv.DetectionDataset.from_yolo(
|
|
299
|
+
images_directory_path=...,
|
|
300
|
+
annotations_directory_path=...,
|
|
301
|
+
data_yaml_path=...,
|
|
302
|
+
).as_pascal_voc(
|
|
303
|
+
images_directory_path=...,
|
|
304
|
+
annotations_directory_path=...,
|
|
305
|
+
)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
</details>
|
|
309
|
+
|
|
310
|
+
## 🎬 Tutorials
|
|
311
|
+
|
|
312
|
+
Want to learn how to use Supervision? Explore our [how-to guides](https://supervision.roboflow.com/develop/how_to/detect_and_annotate/), [end-to-end examples](./examples), [cheatsheet](https://roboflow.github.io/cheatsheet-supervision/), and [cookbooks](https://supervision.roboflow.com/develop/cookbooks/)!
|
|
313
|
+
|
|
314
|
+
<br/>
|
|
315
|
+
|
|
316
|
+
<p align="left">
|
|
317
|
+
<a href="https://youtu.be/hAWpsIuem10" title="Dwell Time Analysis with Computer Vision | Real-Time Stream Processing"><img src="https://github.com/user-attachments/assets/014cffc7-72b3-4c0a-bb89-6de265b2c06b" alt="Dwell Time Analysis with Computer Vision | Real-Time Stream Processing" width="300px" align="left" /></a>
|
|
318
|
+
<a href="https://youtu.be/hAWpsIuem10" title="Dwell Time Analysis with Computer Vision | Real-Time Stream Processing"><strong>Dwell Time Analysis with Computer Vision | Real-Time Stream Processing</strong></a>
|
|
319
|
+
<div><strong>Created: 5 Apr 2024</strong></div>
|
|
320
|
+
<br/>Learn how to use computer vision to analyze wait times and optimize processes. This tutorial covers object detection, tracking, and calculating time spent in designated zones. Use these techniques to improve customer experience in retail, traffic management, or other scenarios.</p>
|
|
321
|
+
|
|
322
|
+
<br/>
|
|
323
|
+
|
|
324
|
+
<p align="left">
|
|
325
|
+
<a href="https://youtu.be/uWP6UjDeZvY" title="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source"><img src="https://github.com/user-attachments/assets/b16b8e21-dc6c-4a73-a678-2f7d5d374793" alt="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source" width="300px" align="left" /></a>
|
|
326
|
+
<a href="https://youtu.be/uWP6UjDeZvY" title="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source"><strong>Speed Estimation & Vehicle Tracking | Computer Vision | Open Source</strong></a>
|
|
327
|
+
<div><strong>Created: 11 Jan 2024</strong></div>
|
|
328
|
+
<br/>Learn how to track and estimate the speed of vehicles using YOLO, ByteTrack, and Roboflow Inference. This comprehensive tutorial covers object detection, multi-object tracking, filtering detections, perspective transformation, speed estimation, visualization improvements, and more.</p>
|
|
329
|
+
|
|
330
|
+
## 💜 Built with Supervision
|
|
331
|
+
|
|
332
|
+
Did you build something cool using supervision? [Let us know!](https://github.com/roboflow/supervision/discussions/categories/built-with-supervision)
|
|
333
|
+
|
|
334
|
+
https://user-images.githubusercontent.com/26109316/207858600-ee862b22-0353-440b-ad85-caa0c4777904.mp4
|
|
335
|
+
|
|
336
|
+
https://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c-60e9c81b3900
|
|
337
|
+
|
|
338
|
+
https://github.com/roboflow/supervision/assets/26109316/3ac6982f-4943-4108-9b7f-51787ef1a69f
|
|
339
|
+
|
|
340
|
+
## 📚 Documentation
|
|
341
|
+
|
|
342
|
+
Visit our [documentation](https://roboflow.github.io/supervision) page to learn how supervision can help you build computer vision applications faster and more reliably.
|
|
343
|
+
|
|
344
|
+
## 🏆 Contribution
|
|
345
|
+
|
|
346
|
+
We love your input! Please see our [contributing guide](.github/CONTRIBUTING.md) to get started. Thank you 🙏 to all our contributors!
|
|
347
|
+
|
|
348
|
+
<p align="center">
|
|
349
|
+
<a href="https://github.com/roboflow/supervision/graphs/contributors">
|
|
350
|
+
<img src="https://contrib.rocks/image?repo=roboflow/supervision" />
|
|
351
|
+
</a>
|
|
352
|
+
</p>
|
|
353
|
+
|
|
354
|
+
<br>
|
|
355
|
+
|
|
356
|
+
<div align="center">
|
|
357
|
+
<a href="https://youtube.com/roboflow">
|
|
358
|
+
<img
|
|
359
|
+
src="https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634652"
|
|
360
|
+
width="3%"
|
|
361
|
+
/>
|
|
362
|
+
</a>
|
|
363
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
|
|
364
|
+
<a href="https://roboflow.com">
|
|
365
|
+
<img
|
|
366
|
+
src="https://media.roboflow.com/notebooks/template/icons/purple/roboflow-app.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949746649"
|
|
367
|
+
width="3%"
|
|
368
|
+
/>
|
|
369
|
+
</a>
|
|
370
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
|
|
371
|
+
<a href="https://www.linkedin.com/company/roboflow-ai/">
|
|
372
|
+
<img
|
|
373
|
+
src="https://media.roboflow.com/notebooks/template/icons/purple/linkedin.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633691"
|
|
374
|
+
width="3%"
|
|
375
|
+
/>
|
|
376
|
+
</a>
|
|
377
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
|
|
378
|
+
<a href="https://docs.roboflow.com">
|
|
379
|
+
<img
|
|
380
|
+
src="https://media.roboflow.com/notebooks/template/icons/purple/knowledge.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634511"
|
|
381
|
+
width="3%"
|
|
382
|
+
/>
|
|
383
|
+
</a>
|
|
384
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
|
|
385
|
+
<a href="https://discuss.roboflow.com">
|
|
386
|
+
<img
|
|
387
|
+
src="https://media.roboflow.com/notebooks/template/icons/purple/forum.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633584"
|
|
388
|
+
width="3%"
|
|
389
|
+
/>
|
|
390
|
+
</a>
|
|
391
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
|
|
392
|
+
<a href="https://blog.roboflow.com">
|
|
393
|
+
<img
|
|
394
|
+
src="https://media.roboflow.com/notebooks/template/icons/purple/blog.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633605"
|
|
395
|
+
width="3%"
|
|
396
|
+
/>
|
|
397
|
+
</a>
|
|
398
|
+
</div>
|