Skip to content

Commit

Permalink
Mkdocs annotations fixes (ultralytics#7600)
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Jocher <[email protected]>
  • Loading branch information
glenn-jocher authored Jan 15, 2024
1 parent 22651d0 commit b128254
Show file tree
Hide file tree
Showing 24 changed files with 137 additions and 63 deletions.
15 changes: 8 additions & 7 deletions docs/en/guides/distance-calculation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Measuring the gap between two objects is known as distance calculation within a
!!! Example "Distance Calculation using YOLOv8 Example"

=== "Video Stream"

```python
from ultralytics import YOLO
from ultralytics.solutions import distance_calculation
Expand Down Expand Up @@ -68,13 +69,13 @@ Measuring the gap between two objects is known as distance calculation within a

### Optional Arguments `set_args`

| Name | Type | Default | Description |
|----------------|--------|-----------------|--------------------------------------------------------|
| names | `dict` | `None` | Classes names |
| view_img | `bool` | `False` | Display frames with counts |
| line_thickness | `int` | `2` | Increase bounding boxes thickness |
| line_color | `RGB` | `(255, 255, 0)` | Line Color for centroids mapping on two bounding boxes |
| centroid_color | `RGB` | `(255, 0, 255)` | Centroid color for each bounding box |
| Name | Type | Default | Description |
|------------------|--------|-----------------|--------------------------------------------------------|
| `names` | `dict` | `None` | Classes names |
| `view_img` | `bool` | `False` | Display frames with counts |
| `line_thickness` | `int` | `2` | Increase bounding boxes thickness |
| `line_color` | `RGB` | `(255, 255, 0)` | Line Color for centroids mapping on two bounding boxes |
| `centroid_color` | `RGB` | `(255, 0, 255)` | Centroid color for each bounding box |

### Arguments `model.track`

Expand Down
37 changes: 21 additions & 16 deletions docs/en/guides/heatmaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult
!!! Example "Heatmaps using Ultralytics YOLOv8 Example"

=== "Heatmap"

```python
from ultralytics import YOLO
from ultralytics.solutions import heatmap
Expand Down Expand Up @@ -83,6 +84,7 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult
```

=== "Line Counting"

```python
from ultralytics import YOLO
from ultralytics.solutions import heatmap
Expand Down Expand Up @@ -126,6 +128,7 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult
```

=== "Region Counting"

```python
from ultralytics import YOLO
from ultralytics.solutions import heatmap
Expand Down Expand Up @@ -170,6 +173,7 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult
```

=== "Im0"

```python
from ultralytics import YOLO
from ultralytics.solutions import heatmap
Expand All @@ -194,6 +198,7 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult
```

=== "Specific Classes"

```python
from ultralytics import YOLO
from ultralytics.solutions import heatmap
Expand Down Expand Up @@ -238,22 +243,22 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult

### Arguments `set_args`

| Name | Type | Default | Description |
|---------------------|----------------|-------------------|-----------------------------------------------------------|
| view_img | `bool` | `False` | Display the frame with heatmap |
| colormap | `cv2.COLORMAP` | `None` | cv2.COLORMAP for heatmap |
| imw | `int` | `None` | Width of Heatmap |
| imh | `int` | `None` | Height of Heatmap |
| heatmap_alpha | `float` | `0.5` | Heatmap alpha value |
| count_reg_pts | `list` | `None` | Object counting region points |
| count_txt_thickness | `int` | `2` | Count values text size |
| count_txt_color | `RGB Color` | `(0, 0, 0)` | Foreground color for Object counts text |
| count_color | `RGB Color` | `(255, 255, 255)` | Background color for Object counts text |
| count_reg_color | `RGB Color` | `(255, 0, 255)` | Counting region color |
| region_thickness | `int` | `5` | Counting region thickness value |
| decay_factor | `float` | `0.99` | Decay factor for heatmap area removal after specific time |
| shape | `str` | `circle` | Heatmap shape for display "rect" or "circle" supported |
| line_dist_thresh | `int` | `15` | Euclidean Distance threshold for line counter |
| Name | Type | Default | Description |
|-----------------------|----------------|-------------------|-----------------------------------------------------------|
| `view_img` | `bool` | `False` | Display the frame with heatmap |
| `colormap` | `cv2.COLORMAP` | `None` | cv2.COLORMAP for heatmap |
| `imw` | `int` | `None` | Width of Heatmap |
| `imh` | `int` | `None` | Height of Heatmap |
| `heatmap_alpha` | `float` | `0.5` | Heatmap alpha value |
| `count_reg_pts` | `list` | `None` | Object counting region points |
| `count_txt_thickness` | `int` | `2` | Count values text size |
| `count_txt_color` | `RGB Color` | `(0, 0, 0)` | Foreground color for Object counts text |
| `count_color` | `RGB Color` | `(255, 255, 255)` | Background color for Object counts text |
| `count_reg_color` | `RGB Color` | `(255, 0, 255)` | Counting region color |
| `region_thickness` | `int` | `5` | Counting region thickness value |
| `decay_factor` | `float` | `0.99` | Decay factor for heatmap area removal after specific time |
| `shape` | `str` | `circle` | Heatmap shape for display "rect" or "circle" supported |
| `line_dist_thresh` | `int` | `15` | Euclidean Distance threshold for line counter |

### Arguments `model.track`

Expand Down
2 changes: 2 additions & 0 deletions docs/en/guides/instance-segmentation-and-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ There are two types of instance segmentation tracking available in the Ultralyti
!!! Example "Instance Segmentation and Tracking"

=== "Instance Segmentation"

```python
import cv2
from ultralytics import YOLO
Expand Down Expand Up @@ -68,6 +69,7 @@ There are two types of instance segmentation tracking available in the Ultralyti
```

=== "Instance Segmentation with Object Tracking"

```python
import cv2
from ultralytics import YOLO
Expand Down
1 change: 1 addition & 0 deletions docs/en/guides/object-blurring.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Object blurring with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
!!! Example "Object Blurring using YOLOv8 Example"

=== "Object Blurring"

```python
from ultralytics import YOLO
from ultralytics.utils.plotting import Annotator, colors
Expand Down
4 changes: 3 additions & 1 deletion docs/en/guides/object-counting.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
!!! Example "Object Counting using YOLOv8 Example"

=== "Region"

```python
from ultralytics import YOLO
from ultralytics.solutions import object_counter
Expand Down Expand Up @@ -76,10 +77,10 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
cap.release()
video_writer.release()
cv2.destroyAllWindows()

```

=== "Line"

```python
from ultralytics import YOLO
from ultralytics.solutions import object_counter
Expand Down Expand Up @@ -122,6 +123,7 @@ Object counting with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
```

=== "Specific Classes"

```python
from ultralytics import YOLO
from ultralytics.solutions import object_counter
Expand Down
1 change: 1 addition & 0 deletions docs/en/guides/object-cropping.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Object cropping with [Ultralytics YOLOv8](https://github.com/ultralytics/ultraly
!!! Example "Object Cropping using YOLOv8 Example"

=== "Object Cropping"

```python
from ultralytics import YOLO
from ultralytics.utils.plotting import Annotator, colors
Expand Down
17 changes: 9 additions & 8 deletions docs/en/guides/speed-estimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Speed estimation is the process of calculating the rate of movement of an object
!!! Example "Speed Estimation using YOLOv8 Example"

=== "Speed Estimation"

```python
from ultralytics import YOLO
from ultralytics.solutions import speed_estimation
Expand Down Expand Up @@ -76,14 +77,14 @@ Speed estimation is the process of calculating the rate of movement of an object

### Optional Arguments `set_args`

| Name | Type | Default | Description |
|------------------|--------|----------------------------|---------------------------------------------------|
| reg_pts | `list` | `[(20, 400), (1260, 400)]` | Points defining the Region Area |
| names | `dict` | `None` | Classes names |
| view_img | `bool` | `False` | Display frames with counts |
| line_thickness | `int` | `2` | Increase bounding boxes thickness |
| region_thickness | `int` | `5` | Thickness for object counter region or line |
| spdl_dist_thresh | `int` | `10` | Euclidean Distance threshold for speed check line |
| Name | Type | Default | Description |
|--------------------|--------|----------------------------|---------------------------------------------------|
| `reg_pts` | `list` | `[(20, 400), (1260, 400)]` | Points defining the Region Area |
| `names` | `dict` | `None` | Classes names |
| `view_img` | `bool` | `False` | Display frames with counts |
| `line_thickness` | `int` | `2` | Increase bounding boxes thickness |
| `region_thickness` | `int` | `5` | Thickness for object counter region or line |
| `spdl_dist_thresh` | `int` | `10` | Euclidean Distance threshold for speed check line |

### Arguments `model.track`

Expand Down
2 changes: 2 additions & 0 deletions docs/en/guides/vision-eye.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ keywords: Ultralytics, YOLOv8, Object Detection, Object Tracking, IDetection, Vi
!!! Example "VisionEye Object Mapping using YOLOv8"

=== "VisionEye Object Mapping"

```python
import cv2
from ultralytics import YOLO
Expand Down Expand Up @@ -62,6 +63,7 @@ keywords: Ultralytics, YOLOv8, Object Detection, Object Tracking, IDetection, Vi
```

=== "VisionEye Object Mapping with Object Tracking"

```python
import cv2
from ultralytics import YOLO
Expand Down
18 changes: 10 additions & 8 deletions docs/en/guides/workouts-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Monitoring workouts through pose estimation with [Ultralytics YOLOv8](https://gi
!!! Example "Workouts Monitoring Example"

=== "Workouts Monitoring"

```python
from ultralytics import YOLO
from ultralytics.solutions import ai_gym
Expand Down Expand Up @@ -56,6 +57,7 @@ Monitoring workouts through pose estimation with [Ultralytics YOLOv8](https://gi
```

=== "Workouts Monitoring with Save Output"

```python
from ultralytics import YOLO
from ultralytics.solutions import ai_gym
Expand Down Expand Up @@ -102,14 +104,14 @@ Monitoring workouts through pose estimation with [Ultralytics YOLOv8](https://gi

### Arguments `set_args`

| Name | Type | Default | Description |
|-----------------|--------|----------|----------------------------------------------------------------------------------------|
| kpts_to_check | `list` | `None` | List of three keypoints index, for counting specific workout, followed by keypoint Map |
| view_img | `bool` | `False` | Display the frame with counts |
| line_thickness | `int` | `2` | Increase the thickness of count value |
| pose_type | `str` | `pushup` | Pose that need to be monitored, "pullup" and "abworkout" also supported |
| pose_up_angle | `int` | `145` | Pose Up Angle value |
| pose_down_angle | `int` | `90` | Pose Down Angle value |
| Name | Type | Default | Description |
|-------------------|--------|----------|----------------------------------------------------------------------------------------|
| `kpts_to_check` | `list` | `None` | List of three keypoints index, for counting specific workout, followed by keypoint Map |
| `view_img` | `bool` | `False` | Display the frame with counts |
| `line_thickness` | `int` | `2` | Increase the thickness of count value |
| `pose_type` | `str` | `pushup` | Pose that need to be monitored, "pullup" and "abworkout" also supported |
| `pose_up_angle` | `int` | `145` | Pose Up Angle value |
| `pose_down_angle` | `int` | `90` | Pose Down Angle value |

### Arguments `model.predict`

Expand Down
12 changes: 12 additions & 0 deletions docs/en/hub/inference_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ YOLO detection models, such as `yolov8n.pt`, can return JSON responses from loca
!!! Example "Detect Model JSON Response"

=== "Local"

```python
from ultralytics import YOLO

Expand All @@ -122,6 +123,7 @@ YOLO detection models, such as `yolov8n.pt`, can return JSON responses from loca
```

=== "CLI API"

```bash
curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \
-H "x-api-key: API_KEY" \
Expand All @@ -132,6 +134,7 @@ YOLO detection models, such as `yolov8n.pt`, can return JSON responses from loca
```

=== "Python API"

```python
import requests

Expand All @@ -153,6 +156,7 @@ YOLO detection models, such as `yolov8n.pt`, can return JSON responses from loca
```

=== "JSON Response"

```json
{
"success": True,
Expand Down Expand Up @@ -202,6 +206,7 @@ YOLO segmentation models, such as `yolov8n-seg.pt`, can return JSON responses fr
!!! Example "Segment Model JSON Response"

=== "Local"

```python
from ultralytics import YOLO

Expand All @@ -216,6 +221,7 @@ YOLO segmentation models, such as `yolov8n-seg.pt`, can return JSON responses fr
```

=== "CLI API"

```bash
curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \
-H "x-api-key: API_KEY" \
Expand All @@ -226,6 +232,7 @@ YOLO segmentation models, such as `yolov8n-seg.pt`, can return JSON responses fr
```

=== "Python API"

```python
import requests

Expand All @@ -247,6 +254,7 @@ YOLO segmentation models, such as `yolov8n-seg.pt`, can return JSON responses fr
```

=== "JSON Response"

Note `segments` `x` and `y` lengths may vary from one object to another. Larger or more complex objects may have more segment points.
```json
{
Expand Down Expand Up @@ -339,6 +347,7 @@ YOLO pose models, such as `yolov8n-pose.pt`, can return JSON responses from loca
!!! Example "Pose Model JSON Response"

=== "Local"

```python
from ultralytics import YOLO

Expand All @@ -353,6 +362,7 @@ YOLO pose models, such as `yolov8n-pose.pt`, can return JSON responses from loca
```

=== "CLI API"

```bash
curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \
-H "x-api-key: API_KEY" \
Expand All @@ -363,6 +373,7 @@ YOLO pose models, such as `yolov8n-pose.pt`, can return JSON responses from loca
```

=== "Python API"

```python
import requests

Expand All @@ -384,6 +395,7 @@ YOLO pose models, such as `yolov8n-pose.pt`, can return JSON responses from loca
```

=== "JSON Response"

Note COCO-keypoints pretrained models will have 17 human keypoints. The `visible` part of the keypoints indicates whether a keypoint is visible or obscured. Obscured keypoints may be outside the image or may not be visible, i.e. a person's eyes facing away from the camera.
```json
{
Expand Down
1 change: 1 addition & 0 deletions docs/en/integrations/weights-biases.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Start by initializing the Weights & Biases environment in your workspace. You ca
!!! Tip "Initial SDK Setup"

=== "CLI"

```bash
# Initialize your Weights & Biases environment
import wandb
Expand Down
4 changes: 4 additions & 0 deletions docs/en/models/fast-sam.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ To perform object detection on an image, use the `predict` method as shown below
!!! Example

=== "Python"

```python
from ultralytics import FastSAM
from ultralytics.models.fastsam import FastSAMPrompt
Expand Down Expand Up @@ -83,6 +84,7 @@ To perform object detection on an image, use the `predict` method as shown below
```

=== "CLI"

```bash
# Load a FastSAM model and segment everything with it
yolo segment predict model=FastSAM-s.pt source=path/to/bus.jpg imgsz=640
Expand All @@ -97,6 +99,7 @@ Validation of the model on a dataset can be done as follows:
!!! Example

=== "Python"

```python
from ultralytics import FastSAM

Expand All @@ -108,6 +111,7 @@ Validation of the model on a dataset can be done as follows:
```

=== "CLI"

```bash
# Load a FastSAM model and validate it on the COCO8 example dataset at image size 640
yolo segment val model=FastSAM-s.pt data=coco8.yaml imgsz=640
Expand Down
Loading

0 comments on commit b128254

Please sign in to comment.