Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support latest ultralytics #27

Merged
merged 3 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
huggingface_hub
fire
ultralytics>=8.0.7,<8.0.8
ultralytics>=8.0.7,<8.0.9
sahi>=0.11.11,<0.12.0
pandas
26 changes: 14 additions & 12 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,32 @@ def run(cmd):
subprocess.run(cmd.split(), check=True)


def test_checks():
run('yolo mode=checks')
def test_special_modes():
run('yolo checks')
run('yolo settings')
run('yolo help')


# Train checks ---------------------------------------------------------------------------------------------------------
def test_train_det():
run(f'yolo mode=train task=detect model={CFG}.yaml data=coco8.yaml imgsz=32 epochs=1')
run(f'yolo train detect model={CFG}.yaml data=coco8.yaml imgsz=32 epochs=1')


def test_train_seg():
run(f'yolo mode=train task=segment model={CFG}-seg.yaml data=coco8-seg.yaml imgsz=32 epochs=1')
run(f'yolo train segment model={CFG}-seg.yaml data=coco8-seg.yaml imgsz=32 epochs=1')


def test_train_cls():
run(f'yolo mode=train task=classify model={CFG}-cls.yaml data=mnist160 imgsz=32 epochs=1')
run(f'yolo train classify model={CFG}-cls.yaml data=mnist160 imgsz=32 epochs=1')


# Val checks -----------------------------------------------------------------------------------------------------------
def test_val_detect():
run(f'yolo mode=val task=detect model={MODEL}.pt data=coco8.yaml imgsz=32 epochs=1')
run(f'yolo val detect model={MODEL}.pt data=coco8.yaml imgsz=32 epochs=1')


def test_val_segment():
run(f'yolo mode=val task=segment model={MODEL}-seg.pt data=coco8-seg.yaml imgsz=32 epochs=1')
run(f'yolo val segment model={MODEL}-seg.pt data=coco8-seg.yaml imgsz=32 epochs=1')


def test_val_classify():
Expand All @@ -47,11 +49,11 @@ def test_val_classify():

# Predict checks -------------------------------------------------------------------------------------------------------
def test_predict_detect():
run(f"yolo mode=predict task=detect model={MODEL}.pt source={SOURCE}")
run(f"yolo predict detect model={MODEL}.pt source={SOURCE}")


def test_predict_segment():
run(f"yolo mode=predict task=segment model={MODEL}-seg.pt source={SOURCE}")
run(f"yolo predict segment model={MODEL}-seg.pt source={SOURCE}")


def test_predict_classify():
Expand All @@ -60,12 +62,12 @@ def test_predict_classify():

# Export checks --------------------------------------------------------------------------------------------------------
def test_export_detect_torchscript():
run(f'yolo mode=export model={MODEL}.pt format=torchscript')
run(f'yolo export model={MODEL}.pt format=torchscript')


def test_export_segment_torchscript():
run(f'yolo mode=export model={MODEL}-seg.pt format=torchscript')
run(f'yolo export model={MODEL}-seg.pt format=torchscript')


def test_export_classify_torchscript():
run(f'yolo mode=export model={MODEL}-cls.pt format=torchscript')
run(f'yolo export model={MODEL}-cls.pt format=torchscript')
2 changes: 1 addition & 1 deletion ultralyticsplus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .hf_utils import download_from_hub, push_to_hfhub
from .ultralytics_utils import YOLO, postprocess_classify_output, render_result

__version__ = "0.0.13"
__version__ = "0.0.14"