Merge branch 'main' into quan

mct-2.1.1
Francesco Mattioli 5 months ago committed by GitHub
commit f102487abc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      docs/en/datasets/classify/cifar10.md
  2. 11
      docs/en/datasets/classify/imagewoof.md
  3. 2
      docs/en/datasets/detect/roboflow-100.md
  4. 7
      docs/en/datasets/detect/visdrone.md
  5. 4
      docs/en/datasets/segment/crack-seg.md
  6. 8
      docs/en/datasets/segment/package-seg.md
  7. 11
      docs/en/guides/parking-management.md
  8. 2
      ultralytics/__init__.py
  9. 4
      ultralytics/engine/results.py
  10. 24
      ultralytics/hub/session.py
  11. 9
      ultralytics/utils/__init__.py

@ -153,6 +153,10 @@ Each subset comprises images categorized into 10 classes, with their annotations
If you use the CIFAR-10 dataset in your research or development projects, make sure to cite the following paper:
!!! Quote ""
=== "BibTeX"
```bibtex
@TECHREPORT{Krizhevsky09learningmultiple,
author={Alex Krizhevsky},

@ -59,6 +59,10 @@ ImageWoof dataset comes in three different sizes to accommodate various research
To use these variants in your training, simply replace 'imagewoof' in the dataset argument with 'imagewoof320' or 'imagewoof160'. For example:
!!! Example "Example"
=== "Python"
```python
from ultralytics import YOLO
@ -72,6 +76,13 @@ model.train(data="imagewoof320", epochs=100, imgsz=224)
model.train(data="imagewoof160", epochs=100, imgsz=224)
```
=== "CLI"
```bash
# Load a pretrained model and train on the small-sized dataset
yolo classify train model=yolov8n-cls.pt data=imagewoof320 epochs=100 imgsz=224
```
It's important to note that using smaller images will likely yield lower performance in terms of classification accuracy. However, it's an excellent way to iterate quickly in the early stages of model development and prototyping.
## Sample Images and Annotations

@ -203,7 +203,7 @@ The **Roboflow 100** dataset is accessible on [GitHub](https://github.com/robofl
When using the Roboflow 100 dataset in your research, ensure to properly cite it. Here is the recommended citation:
!!! Quote
!!! Quote ""
=== "BibTeX"

@ -159,7 +159,9 @@ The configuration file for the VisDrone dataset, `VisDrone.yaml`, can be found i
If you use the VisDrone dataset in your research or development work, please cite the following paper:
!!! Quote "BibTeX"
!!! Quote ""
=== "BibTeX"
```bibtex
@ARTICLE{9573394,
@ -170,5 +172,6 @@ If you use the VisDrone dataset in your research or development work, please cit
volume={},
number={},
pages={1-1},
doi={10.1109/TPAMI.2021.3119563}}
doi={10.1109/TPAMI.2021.3119563}
}
```

@ -135,6 +135,10 @@ Ultralytics YOLO offers advanced real-time object detection, segmentation, and c
If you incorporate the Crack Segmentation Dataset into your research, please use the following BibTeX reference:
!!! Quote ""
=== "BibTeX"
```bibtex
@misc{ crack-bphdr_dataset,
title = { crack Dataset },

@ -99,7 +99,11 @@ The [Roboflow Package Segmentation Dataset](https://universe.roboflow.com/factor
### How do I train an Ultralytics YOLOv8 model on the Package Segmentation Dataset?
You can train an Ultralytics YOLOv8n model using both Python and CLI methods. For Python, use the snippet below:
You can train an Ultralytics YOLOv8n model using both Python and CLI methods. Use the snippets below:
!!! Example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
@ -111,7 +115,7 @@ model = YOLO("yolov8n-seg.pt") # load a pretrained model
results = model.train(data="package-seg.yaml", epochs=100, imgsz=640)
```
For CLI:
=== "CLI"
```bash
# Start training from a pretrained *.pt model

@ -10,6 +10,17 @@ keywords: parking management, YOLOv8, Ultralytics, vehicle detection, real-time
Parking management with [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics/) ensures efficient and safe parking by organizing spaces and monitoring availability. YOLOv8 can improve parking lot management through real-time vehicle detection, and insights into parking occupancy.
<p align="center">
<br>
<iframe loading="lazy" width="720" height="405" src="https://www.youtube.com/embed/WwXnljc7ZUM"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen>
</iframe>
<br>
<strong>Watch:</strong> How to Implement Parking Management Using Ultralytics YOLOv8 🚀
</p>
## Advantages of Parking Management System?
- **Efficiency**: Parking lot management optimizes the use of parking spaces and reduces congestion.

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.2.80"
__version__ = "8.2.81"
import os

@ -992,8 +992,8 @@ class Boxes(BaseTensor):
Convert bounding boxes from [x1, y1, x2, y2] format to [x, y, width, height] format.
Returns:
(torch.Tensor | numpy.ndarray): Boxes in [x, y, width, height] format, where x, y are the coordinates of
the top-left corner of the bounding box, width, height are the dimensions of the bounding box and the
(torch.Tensor | numpy.ndarray): Boxes in [x_center, y_center, width, height] format, where x_center, y_center are the coordinates of
the center point of the bounding box, width, height are the dimensions of the bounding box and the
shape of the returned tensor is (N, 4), where N is the number of boxes.
Examples:

@ -1,5 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
import shutil
import threading
import time
from http import HTTPStatus
@ -344,23 +345,34 @@ class HUBTrainingSession:
map (float): Mean average precision of the model.
final (bool): Indicates if the model is the final model after training.
"""
if Path(weights).is_file():
progress_total = Path(weights).stat().st_size if final else None # Only show progress if final
weights = Path(weights)
if not weights.is_file():
last = weights.with_name("last" + weights.suffix)
if final and last.is_file():
LOGGER.warning(
f"{PREFIX} ARNING ⚠ Model 'best.pt' not found, copying 'last.pt' to 'best.pt' and uploading. "
"This often happens when resuming training in transient environments like Google Colab. "
"For more reliable training, consider using Ultralytics HUB Cloud. "
"Learn more at https://docs.ultralytics.com/hub/cloud-training/."
)
shutil.copy(last, weights) # copy last.pt to best.pt
else:
LOGGER.warning(f"{PREFIX} WARNING ⚠ Model upload issue. Missing model {weights}.")
return
self.request_queue(
self.model.upload_model,
epoch=epoch,
weights=weights,
weights=str(weights),
is_best=is_best,
map=map,
final=final,
retry=10,
timeout=3600,
thread=not final,
progress_total=progress_total,
progress_total=weights.stat().st_size if final else None, # only show progress if final
stream_response=True,
)
else:
LOGGER.warning(f"{PREFIX}WARNING ⚠ Model upload issue. Missing model {weights}.")
@staticmethod
def _show_upload_progress(content_length: int, response: requests.Response) -> None:

@ -219,14 +219,17 @@ def plt_settings(rcparams=None, backend="Agg"):
def wrapper(*args, **kwargs):
"""Sets rc parameters and backend, calls the original function, and restores the settings."""
original_backend = plt.get_backend()
if backend.lower() != original_backend.lower():
switch = backend.lower() != original_backend.lower()
if switch:
plt.close("all") # auto-close()ing of figures upon backend switching is deprecated since 3.8
plt.switch_backend(backend)
# Plot with backend and always revert to original backend
try:
with plt.rc_context(rcparams):
result = func(*args, **kwargs)
if backend != original_backend:
finally:
if switch:
plt.close("all")
plt.switch_backend(original_backend)
return result

Loading…
Cancel
Save