* Refactor code for speed and clarity

* Update README.zh-CN.md

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn JocherandUltralyticsAssistant authored and GitHub committed 2024-08-26 15:46:32 +02:00
1 parent b40781b3e3
commit c5ffbbf1c3
20 files changed
+164 -73

No files matched your search

+2
View File
@@ -83,6 +83,8 @@ def create_dataloader(
class LoadImagesAndLabelsAndMasks(LoadImagesAndLabels): # for training/testing
"""Loads images, labels, and segmentation masks for training and testing YOLO models with augmentation support."""
def __init__(
self,
path,
+2 -1
View File
@@ -12,7 +12,8 @@ from .general import crop_mask
class ComputeLoss:
# Compute losses
"""Computes the YOLOv5 model's loss components including classification, objectness, box, and mask losses."""
def __init__(self, model, autobalance=False, overlap=False):
"""Initializes the compute loss function for YOLOv5 models with options for autobalancing and overlap
handling.
+2
View File
@@ -54,6 +54,8 @@ def ap_per_class_box_and_mask(
class Metric:
"""Computes performance metrics like precision, recall, F1 score, and average precision for model evaluation."""
def __init__(self) -> None:
"""Initializes performance metric attributes for precision, recall, F1 score, average precision, and class
indices.