ultralytics 8.2.14 add task + OBB to hub.check_dataset() (#12573)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
cf24349efb
commit
fd748e3c7a
5 changed files with 36 additions and 24 deletions
|
|
@ -12,7 +12,7 @@ import yaml
|
|||
from PIL import Image
|
||||
|
||||
from ultralytics import RTDETR, YOLO
|
||||
from ultralytics.cfg import MODELS, TASK2DATA
|
||||
from ultralytics.cfg import MODELS, TASKS, TASK2DATA
|
||||
from ultralytics.data.build import load_inference_source
|
||||
from ultralytics.utils import (
|
||||
ASSETS,
|
||||
|
|
@ -98,6 +98,12 @@ def test_predict_img(model_name):
|
|||
assert len(model(batch, imgsz=32)) == len(batch) # multiple sources in a batch
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", MODELS)
|
||||
def test_predict_visualize(model):
|
||||
"""Test model predict methods with 'visualize=True' arguments."""
|
||||
YOLO(WEIGHTS_DIR / model)(SOURCE, imgsz=32, visualize=True)
|
||||
|
||||
|
||||
def test_predict_grey_and_4ch():
|
||||
"""Test YOLO prediction on SOURCE converted to greyscale and 4-channel images."""
|
||||
im = Image.open(SOURCE)
|
||||
|
|
@ -267,7 +273,7 @@ def test_data_utils():
|
|||
# from ultralytics.utils.files import WorkingDirectory
|
||||
# with WorkingDirectory(ROOT.parent / 'tests'):
|
||||
|
||||
for task in "detect", "segment", "pose", "classify":
|
||||
for task in TASKS:
|
||||
file = Path(TASK2DATA[task]).with_suffix(".zip") # i.e. coco8.zip
|
||||
download(f"https://github.com/ultralytics/hub/raw/main/example_datasets/{file}", unzip=False, dir=TMP)
|
||||
stats = HUBDatasetStats(TMP / file, task=task)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue