* Refactor code for speed and clarity

* Update dataloaders.py

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

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher authored and GitHub committed 2024-07-01 00:17:24 +02:00
1 parent b9019671f4
commit 100a423b66
14 files changed
+30

No files matched your search

+1
View File
@@ -97,6 +97,7 @@ def run(
vid_stride=1, # video frame-rate stride
retina_masks=False,
):
"""Run YOLOv5 segmentation inference on diverse sources including images, videos, directories, and streams."""
source = str(source)
save_img = not nosave and not source.endswith(".txt") # save inference images
is_file = Path(source).suffix[1:] in (IMG_FORMATS + VID_FORMATS)
+3
View File
@@ -184,6 +184,9 @@ def run(
compute_loss=None,
callbacks=Callbacks(),
):
"""Validates a YOLOv5 segmentation model on specified dataset, producing metrics, plots, and optional JSON
output.
"""
if save_json:
check_requirements("pycocotools>=2.0.6")
process = process_mask_native # more accurate