Skip to content

Commit e5894df

Browse files
committed
Reorganize documentation structure and reformat code
Moved advanced filtering documentation to `how_to` directory from `quickstart` to make way for more comprehensive starter guide. Reorganized MkDocs configuration accordingly. Formatted some code in `classification/core.py` and `dataset/core.py` for better readability. Added placeholder files in `how_to` for future guides on object detection, video processing, object tracking, model evaluation, and detections filtering.
1 parent 282db45 commit e5894df

9 files changed

Lines changed: 37 additions & 34 deletions

File tree

docs/how_to/detect_and_annotate.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
🚧 Page under construction.

docs/how_to/evaluate_model.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
🚧 Page under construction.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
## advanced filtering
2-
3-
41
The advanced filtering capabilities of the `Detections` class offer users a versatile and efficient way to narrow down
52
and refine object detections. This section outlines various filtering methods, including filtering by specific class
63
or a set of classes, confidence, object area, bounding box area, relative area, box dimensions, and designated zones.

docs/how_to/process_video.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
🚧 Page under construction.

docs/how_to/track_objects.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
🚧 Page under construction.

mkdocs.yml

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,33 @@ extra_css:
2626

2727
nav:
2828
- Home: index.md
29-
- Quickstart:
30-
- Detections: quickstart/detections.md
31-
- Classifications:
32-
- Core: classification/core.md
33-
- Detections:
34-
- Core: detection/core.md
35-
- Annotate: detection/annotate.md
36-
- Utils: detection/utils.md
37-
- Tools:
38-
- Polygon Zone: detection/tools/polygon_zone.md
39-
- Inference Slicer: detection/tools/inference_slicer.md
40-
- Annotators: annotators.md
41-
- Trackers: trackers.md
42-
- Datasets: datasets.md
43-
- Metrics:
44-
- Object Detection: metrics/detection.md
45-
- Draw:
46-
- Utils: draw/utils.md
47-
- Utils:
48-
- Video: utils/video.md
49-
- Image: utils/image.md
50-
- Notebook: utils/notebook.md
51-
- File: utils/file.md
29+
- How to:
30+
- Detect and Annotate: how_to/detect_and_annotate.md
31+
- Process Video: how_to/process_video.md
32+
- Track Objects: how_to/track_objects.md
33+
- Filter Detections: how_to/filter_detections.md
34+
- Evaluate Model: how_to/evaluate_model.md
35+
- API:
36+
- Classifications:
37+
- Core: classification/core.md
38+
- Detections:
39+
- Core: detection/core.md
40+
- Utils: detection/utils.md
41+
- Tools:
42+
- Polygon Zone: detection/tools/polygon_zone.md
43+
- Inference Slicer: detection/tools/inference_slicer.md
44+
- Annotators: annotators.md
45+
- Trackers: trackers.md
46+
- Datasets: datasets.md
47+
- Metrics:
48+
- Object Detection: metrics/detection.md
49+
- Draw:
50+
- Utils: draw/utils.md
51+
- Utils:
52+
- Video: utils/video.md
53+
- Image: utils/image.md
54+
- Notebook: utils/notebook.md
55+
- File: utils/file.md
5256
- Changelog: changelog.md
5357

5458
theme:

supervision/classification/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def from_ultralytics(cls, ultralytics_results) -> Classifications:
4747
4848
Args:
4949
ultralytics_results (ultralytics.engine.results.Results):
50-
The output Results instance from ultralytics model
50+
The output Results instance from ultralytics model
5151
5252
Returns:
5353
Classifications: A new Classifications object.

supervision/dataset/core.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ def as_pascal_voc(
165165
where the images should be saved.
166166
If not provided, images will not be saved.
167167
annotations_directory_path (Optional[str]): The path to
168-
the directory where the annotations in
169-
PASCAL VOC format should be saved. If not provided,
170-
annotations will not be saved.
168+
the directory where the annotations in PASCAL VOC format should be
169+
saved. If not provided, annotations will not be saved.
171170
min_image_area_percentage (float): The minimum percentage of
172171
detection area relative to
173172
the image area for a detection to be included.
@@ -178,7 +177,7 @@ def as_pascal_voc(
178177
Argument is used only for segmentation datasets.
179178
approximation_percentage (float): The percentage of
180179
polygon points to be removed from the input polygon,
181-
in the range [0, 1). Argument is used only for segmentation datasets.
180+
in the range [0, 1). Argument is used only for segmentation datasets.
182181
"""
183182
if images_directory_path:
184183
save_dataset_images(
@@ -563,8 +562,7 @@ def split(
563562
split_ratio (float, optional): The ratio of the training
564563
set to the entire dataset.
565564
random_state (int, optional): The seed for the
566-
random number generator.
567-
This is used for reproducibility.
565+
random number generator. This is used for reproducibility.
568566
shuffle (bool, optional): Whether to shuffle the data before splitting.
569567
570568
Returns:

supervision/utils/video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def __init__(self, sample_size: int = 30):
213213
"""
214214
Args:
215215
sample_size (int): The maximum number of observations for latency
216-
benchmarking.
216+
benchmarking.
217217
218218
Examples:
219219
```python

0 commit comments

Comments
 (0)