|
21 | 21 | [](https://badge.fury.io/py/supervision) |
22 | 22 | [](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb) |
23 | 23 | [](https://huggingface.co/spaces/Roboflow/Annotators) |
24 | | -[](https://discord.gg/GbfgXGJ8Bk) |
| 24 | +[](https://discord.gg/GbfgXGJ8Bk) |
25 | 25 | [](https://squidfunk.github.io/mkdocs-material/) |
26 | 26 |
|
27 | 27 | <div align="center"> |
|
34 | 34 |
|
35 | 35 | **We write your reusable computer vision tools.** Whether you need to load your dataset from your hard drive, draw detections on an image or video, or count how many detections are in a zone. You can count on us! 🤝 |
36 | 36 |
|
37 | | -[](https://github.com/roboflow/supervision/issues?q=is%3Aissue+is%3Aopen+label%3Ahacktoberfest) |
38 | | - |
39 | 37 | ## 💻 install |
40 | 38 |
|
41 | 39 | Pip install the supervision package in a |
@@ -137,88 +135,88 @@ for path, image, annotation in ds: |
137 | 135 |
|
138 | 136 | - load |
139 | 137 |
|
140 | | - ```python |
141 | | - dataset = sv.DetectionDataset.from_yolo( |
142 | | - images_directory_path=..., |
143 | | - annotations_directory_path=..., |
144 | | - data_yaml_path=... |
145 | | - ) |
146 | | - |
147 | | - dataset = sv.DetectionDataset.from_pascal_voc( |
148 | | - images_directory_path=..., |
149 | | - annotations_directory_path=... |
150 | | - ) |
151 | | - |
152 | | - dataset = sv.DetectionDataset.from_coco( |
153 | | - images_directory_path=..., |
154 | | - annotations_path=... |
155 | | - ) |
156 | | - ``` |
| 138 | + ```python |
| 139 | + dataset = sv.DetectionDataset.from_yolo( |
| 140 | + images_directory_path=..., |
| 141 | + annotations_directory_path=..., |
| 142 | + data_yaml_path=... |
| 143 | + ) |
| 144 | + |
| 145 | + dataset = sv.DetectionDataset.from_pascal_voc( |
| 146 | + images_directory_path=..., |
| 147 | + annotations_directory_path=... |
| 148 | + ) |
| 149 | + |
| 150 | + dataset = sv.DetectionDataset.from_coco( |
| 151 | + images_directory_path=..., |
| 152 | + annotations_path=... |
| 153 | + ) |
| 154 | + ``` |
157 | 155 |
|
158 | 156 | - split |
159 | 157 |
|
160 | | - ```python |
161 | | - train_dataset, test_dataset = dataset.split(split_ratio=0.7) |
162 | | - test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5) |
| 158 | + ```python |
| 159 | + train_dataset, test_dataset = dataset.split(split_ratio=0.7) |
| 160 | + test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5) |
163 | 161 |
|
164 | | - len(train_dataset), len(test_dataset), len(valid_dataset) |
165 | | - # (700, 150, 150) |
166 | | - ``` |
| 162 | + len(train_dataset), len(test_dataset), len(valid_dataset) |
| 163 | + # (700, 150, 150) |
| 164 | + ``` |
167 | 165 |
|
168 | 166 | - merge |
169 | 167 |
|
170 | | - ```python |
171 | | - ds_1 = sv.DetectionDataset(...) |
172 | | - len(ds_1) |
173 | | - # 100 |
174 | | - ds_1.classes |
175 | | - # ['dog', 'person'] |
176 | | - |
177 | | - ds_2 = sv.DetectionDataset(...) |
178 | | - len(ds_2) |
179 | | - # 200 |
180 | | - ds_2.classes |
181 | | - # ['cat'] |
182 | | - |
183 | | - ds_merged = sv.DetectionDataset.merge([ds_1, ds_2]) |
184 | | - len(ds_merged) |
185 | | - # 300 |
186 | | - ds_merged.classes |
187 | | - # ['cat', 'dog', 'person'] |
188 | | - ``` |
| 168 | + ```python |
| 169 | + ds_1 = sv.DetectionDataset(...) |
| 170 | + len(ds_1) |
| 171 | + # 100 |
| 172 | + ds_1.classes |
| 173 | + # ['dog', 'person'] |
| 174 | + |
| 175 | + ds_2 = sv.DetectionDataset(...) |
| 176 | + len(ds_2) |
| 177 | + # 200 |
| 178 | + ds_2.classes |
| 179 | + # ['cat'] |
| 180 | + |
| 181 | + ds_merged = sv.DetectionDataset.merge([ds_1, ds_2]) |
| 182 | + len(ds_merged) |
| 183 | + # 300 |
| 184 | + ds_merged.classes |
| 185 | + # ['cat', 'dog', 'person'] |
| 186 | + ``` |
189 | 187 |
|
190 | 188 | - save |
191 | 189 |
|
192 | | - ```python |
193 | | - dataset.as_yolo( |
194 | | - images_directory_path=..., |
195 | | - annotations_directory_path=..., |
196 | | - data_yaml_path=... |
197 | | - ) |
198 | | - |
199 | | - dataset.as_pascal_voc( |
200 | | - images_directory_path=..., |
201 | | - annotations_directory_path=... |
202 | | - ) |
203 | | - |
204 | | - dataset.as_coco( |
205 | | - images_directory_path=..., |
206 | | - annotations_path=... |
207 | | - ) |
208 | | - ``` |
| 190 | + ```python |
| 191 | + dataset.as_yolo( |
| 192 | + images_directory_path=..., |
| 193 | + annotations_directory_path=..., |
| 194 | + data_yaml_path=... |
| 195 | + ) |
| 196 | + |
| 197 | + dataset.as_pascal_voc( |
| 198 | + images_directory_path=..., |
| 199 | + annotations_directory_path=... |
| 200 | + ) |
| 201 | + |
| 202 | + dataset.as_coco( |
| 203 | + images_directory_path=..., |
| 204 | + annotations_path=... |
| 205 | + ) |
| 206 | + ``` |
209 | 207 |
|
210 | 208 | - convert |
211 | 209 |
|
212 | | - ```python |
213 | | - sv.DetectionDataset.from_yolo( |
214 | | - images_directory_path=..., |
215 | | - annotations_directory_path=..., |
216 | | - data_yaml_path=... |
217 | | - ).as_pascal_voc( |
218 | | - images_directory_path=..., |
219 | | - annotations_directory_path=... |
220 | | - ) |
221 | | - ``` |
| 210 | + ```python |
| 211 | + sv.DetectionDataset.from_yolo( |
| 212 | + images_directory_path=..., |
| 213 | + annotations_directory_path=..., |
| 214 | + data_yaml_path=... |
| 215 | + ).as_pascal_voc( |
| 216 | + images_directory_path=..., |
| 217 | + annotations_directory_path=... |
| 218 | + ) |
| 219 | + ``` |
222 | 220 |
|
223 | 221 | </details> |
224 | 222 |
|
|
0 commit comments