@@ -55,7 +55,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
-[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://pepy.tech/project/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
+[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
```bash
pip install ultralytics
diff --git a/README.zh-CN.md b/README.zh-CN.md
index caf5e6b470..418652edd5 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -8,7 +8,7 @@
-
+
@@ -55,7 +55,7 @@
ๅจ [**Python>=3.8**](https://www.python.org/) ็ฏๅขไธญไฝฟ็จ [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/) ้่ฟ pip ๅฎ่ฃ
ๅ
ๅซๆๆ[ไพ่ต้กน](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) ็ ultralytics ๅ
ใ
-[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://pepy.tech/project/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
+[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
```bash
pip install ultralytics
diff --git a/docker/Dockerfile-jupyter b/docker/Dockerfile-jupyter
index e42639b9b7..0a58bb35fd 100644
--- a/docker/Dockerfile-jupyter
+++ b/docker/Dockerfile-jupyter
@@ -17,7 +17,7 @@ RUN mkdir /data/weights && /usr/local/bin/yolo settings weights_dir="/data/weigh
RUN mkdir /data/runs && /usr/local/bin/yolo settings runs_dir="/data/runs"
# Start JupyterLab with tutorial notebook
-ENTRYPOINT ["/usr/local/bin/jupyter", "lab", "--allow-root", "/ultralytics/examples/tutorial.ipynb"]
+ENTRYPOINT ["/usr/local/bin/jupyter", "lab", "--allow-root", "--ip=*", "/ultralytics/examples/tutorial.ipynb"]
# Usage Examples -------------------------------------------------------------------------------------------------------
diff --git a/docs/README.md b/docs/README.md
index a3d3edb40e..802352b581 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -15,7 +15,7 @@
## ๐ ๏ธ Installation
[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/)
-[![Downloads](https://static.pepy.tech/badge/ultralytics)](https://pepy.tech/project/ultralytics)
+[![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
To install the ultralytics package in developer mode, ensure you have Git and Python 3 installed on your system. Then, follow these steps:
diff --git a/docs/en/guides/analytics.md b/docs/en/guides/analytics.md
index dec9b4cce8..cd7fc40dcf 100644
--- a/docs/en/guides/analytics.md
+++ b/docs/en/guides/analytics.md
@@ -45,126 +45,15 @@ This guide provides a comprehensive overview of three fundamental types of [data
# generate the pie chart
yolo solutions analytics analytics_type="pie" show=True
- ```
-
- === "Python"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
-
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- out = cv2.VideoWriter(
- "ultralytics_analytics.avi",
- cv2.VideoWriter_fourcc(*"MJPG"),
- fps,
- (1920, 1080), # This is fixed
- )
- analytics = solutions.Analytics(
- analytics_type="line",
- show=True,
- )
+ # generate the bar plots
+ yolo solutions analytics analytics_type="bar" show=True
- frame_count = 0
- while cap.isOpened():
- success, im0 = cap.read()
- if success:
- frame_count += 1
- im0 = analytics.process_data(im0, frame_count) # update analytics graph every frame
- out.write(im0) # write the video file
- else:
- break
-
- cap.release()
- out.release()
- cv2.destroyAllWindows()
+ # generate the area plots
+ yolo solutions analytics analytics_type="area" show=True
```
- === "Pie Chart"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
-
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- out = cv2.VideoWriter(
- "ultralytics_analytics.avi",
- cv2.VideoWriter_fourcc(*"MJPG"),
- fps,
- (1920, 1080), # This is fixed
- )
-
- analytics = solutions.Analytics(
- analytics_type="pie",
- show=True,
- )
-
- frame_count = 0
- while cap.isOpened():
- success, im0 = cap.read()
- if success:
- frame_count += 1
- im0 = analytics.process_data(im0, frame_count) # update analytics graph every frame
- out.write(im0) # write the video file
- else:
- break
-
- cap.release()
- out.release()
- cv2.destroyAllWindows()
- ```
-
- === "Bar Plot"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
-
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- out = cv2.VideoWriter(
- "ultralytics_analytics.avi",
- cv2.VideoWriter_fourcc(*"MJPG"),
- fps,
- (1920, 1080), # This is fixed
- )
-
- analytics = solutions.Analytics(
- analytics_type="bar",
- show=True,
- )
-
- frame_count = 0
- while cap.isOpened():
- success, im0 = cap.read()
- if success:
- frame_count += 1
- im0 = analytics.process_data(im0, frame_count) # update analytics graph every frame
- out.write(im0) # write the video file
- else:
- break
-
- cap.release()
- out.release()
- cv2.destroyAllWindows()
- ```
-
- === "Area chart"
+ === "Python"
```python
import cv2
@@ -173,9 +62,9 @@ This guide provides a comprehensive overview of three fundamental types of [data
cap = cv2.VideoCapture("Path/to/video/file.mp4")
assert cap.isOpened(), "Error reading video file"
-
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
+ # Video writer
out = cv2.VideoWriter(
"ultralytics_analytics.avi",
cv2.VideoWriter_fourcc(*"MJPG"),
@@ -183,11 +72,15 @@ This guide provides a comprehensive overview of three fundamental types of [data
(1920, 1080), # This is fixed
)
+ # Init analytics
analytics = solutions.Analytics(
- analytics_type="area",
- show=True,
+ show=True, # Display the output
+ analytics_type="line", # Pass the analytics type, could be "pie", "bar" or "area".
+ model="yolo11n.pt", # Path to the YOLO11 model file
+ # classes=[0, 2], # If you want to count specific classes i.e person and car with COCO pretrained model.
)
+ # Process video
frame_count = 0
while cap.isOpened():
success, im0 = cap.read()
diff --git a/docs/en/guides/distance-calculation.md b/docs/en/guides/distance-calculation.md
index 009899ae3c..c9775124d4 100644
--- a/docs/en/guides/distance-calculation.md
+++ b/docs/en/guides/distance-calculation.md
@@ -55,6 +55,7 @@ Measuring the gap between two objects is known as distance calculation within a
# Init distance-calculation obj
distance = solutions.DistanceCalculation(model="yolo11n.pt", show=True)
+ # Process video
while cap.isOpened():
success, im0 = cap.read()
if not success:
diff --git a/docs/en/guides/heatmaps.md b/docs/en/guides/heatmaps.md
index 66c26eaa01..038929ccfd 100644
--- a/docs/en/guides/heatmaps.md
+++ b/docs/en/guides/heatmaps.md
@@ -47,119 +47,12 @@ A heatmap generated with [Ultralytics YOLO11](https://github.com/ultralytics/ult
# Pass a custom colormap
yolo solutions heatmap colormap=cv2.COLORMAP_INFERNO
- ```
-
- === "Python"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- # Video writer
- video_writer = cv2.VideoWriter("heatmap_output.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
-
- # Init heatmap
- heatmap = solutions.Heatmap(
- show=True,
- model="yolo11n.pt",
- colormap=cv2.COLORMAP_PARULA,
- )
-
- while cap.isOpened():
- success, im0 = cap.read()
- if not success:
- print("Video frame is empty or video processing has been successfully completed.")
- break
- im0 = heatmap.generate_heatmap(im0)
- video_writer.write(im0)
-
- cap.release()
- video_writer.release()
- cv2.destroyAllWindows()
- ```
-
- === "Line Counting"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- # Video writer
- video_writer = cv2.VideoWriter("heatmap_output.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
- # line for object counting
- line_points = [(20, 400), (1080, 404)]
-
- # Init heatmap
- heatmap = solutions.Heatmap(
- show=True,
- model="yolo11n.pt",
- colormap=cv2.COLORMAP_PARULA,
- region=line_points,
- )
-
- while cap.isOpened():
- success, im0 = cap.read()
- if not success:
- print("Video frame is empty or video processing has been successfully completed.")
- break
- im0 = heatmap.generate_heatmap(im0)
- video_writer.write(im0)
-
- cap.release()
- video_writer.release()
- cv2.destroyAllWindows()
+ # Heatmaps + object counting
+ yolo solutions heatmap region=[(20, 400), (1080, 404), (1080, 360), (20, 360)]
```
- === "Polygon Counting"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- # Video writer
- video_writer = cv2.VideoWriter("heatmap_output.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
-
- # Define polygon points
- region_points = [(20, 400), (1080, 404), (1080, 360), (20, 360), (20, 400)]
-
- # Init heatmap
- heatmap = solutions.Heatmap(
- show=True,
- model="yolo11n.pt",
- colormap=cv2.COLORMAP_PARULA,
- region=region_points,
- )
-
- while cap.isOpened():
- success, im0 = cap.read()
- if not success:
- print("Video frame is empty or video processing has been successfully completed.")
- break
- im0 = heatmap.generate_heatmap(im0)
- video_writer.write(im0)
-
- cap.release()
- video_writer.release()
- cv2.destroyAllWindows()
- ```
-
- === "Region Counting"
+ === "Python"
```python
import cv2
@@ -173,51 +66,24 @@ A heatmap generated with [Ultralytics YOLO11](https://github.com/ultralytics/ult
# Video writer
video_writer = cv2.VideoWriter("heatmap_output.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
- # Define region points
- region_points = [(20, 400), (1080, 404), (1080, 360), (20, 360)]
-
- # Init heatmap
- heatmap = solutions.Heatmap(
- show=True,
- model="yolo11n.pt",
- colormap=cv2.COLORMAP_PARULA,
- region=region_points,
- )
-
- while cap.isOpened():
- success, im0 = cap.read()
- if not success:
- print("Video frame is empty or video processing has been successfully completed.")
- break
- im0 = heatmap.generate_heatmap(im0)
- video_writer.write(im0)
-
- cap.release()
- video_writer.release()
- cv2.destroyAllWindows()
- ```
-
- === "Specific Classes"
-
- ```python
- import cv2
-
- from ultralytics import solutions
-
- cap = cv2.VideoCapture("Path/to/video/file.mp4")
- assert cap.isOpened(), "Error reading video file"
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
-
- # Video writer
- video_writer = cv2.VideoWriter("heatmap_output.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
+ # In case you want to apply object counting + heatmaps, you can pass region points.
+ # region_points = [(20, 400), (1080, 404)] # Define line points
+ # region_points = [(20, 400), (1080, 404), (1080, 360), (20, 360)] # Define region points
+ # region_points = [(20, 400), (1080, 404), (1080, 360), (20, 360), (20, 400)] # Define polygon points
# Init heatmap
heatmap = solutions.Heatmap(
- show=True,
- model="yolo11n.pt",
- classes=[0, 2],
+ show=True, # Display the output
+ model="yolo11n.pt", # Path to the YOLO11 model file
+ colormap=cv2.COLORMAP_PARULA, # Colormap of heatmap
+ # region=region_points, # If you want to do object counting with heatmaps, you can pass region_points
+ # classes=[0, 2], # If you want to generate heatmap for specific classes i.e person and car.
+ # show_in=True, # Display in counts
+ # show_out=True, # Display out counts
+ # line_width=2, # Adjust the line width for bounding boxes and text display
)
+ # Process video
while cap.isOpened():
success, im0 = cap.read()
if not success:
diff --git a/docs/en/guides/object-counting.md b/docs/en/guides/object-counting.md
index 144555793d..ba21ffac2b 100644
--- a/docs/en/guides/object-counting.md
+++ b/docs/en/guides/object-counting.md
@@ -19,7 +19,7 @@ Object counting with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
allowfullscreen>
-
Watch: Object Counting using Ultralytics YOLO11
+
Watch: Object Counting using Ultralytics YOLOv8
|