You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.5 KiB
64 lines
1.5 KiB
2 years ago
|
import os
|
||
2 years ago
|
from pathlib import Path
|
||
2 years ago
|
|
||
2 years ago
|
from ultralytics.yolo.utils import ROOT, SETTINGS
|
||
|
|
||
|
MODEL = Path(SETTINGS['weights_dir']) / 'yolov8n.pt'
|
||
|
CFG = 'yolov8n.yaml'
|
||
2 years ago
|
|
||
|
|
||
|
def test_checks():
|
||
|
os.system('yolo mode=checks')
|
||
|
|
||
|
|
||
|
# Train checks ---------------------------------------------------------------------------------------------------------
|
||
|
def test_train_detect():
|
||
2 years ago
|
os.system(f'yolo mode=train task=detect model={MODEL} data=coco128.yaml imgsz=32 epochs=1')
|
||
2 years ago
|
|
||
|
|
||
|
def test_train_segment():
|
||
|
os.system('yolo mode=train task=segment model=yolov8n-seg.yaml data=coco128-seg.yaml imgsz=32 epochs=1')
|
||
|
|
||
|
|
||
|
def test_train_classify():
|
||
|
pass
|
||
|
|
||
|
|
||
|
# Val checks -----------------------------------------------------------------------------------------------------------
|
||
|
def test_val_detect():
|
||
2 years ago
|
os.system(f'yolo mode=val task=detect model={MODEL} data=coco128.yaml imgsz=32 epochs=1')
|
||
2 years ago
|
|
||
|
|
||
|
def test_val_segment():
|
||
|
pass
|
||
|
|
||
|
|
||
|
def test_val_classify():
|
||
|
pass
|
||
|
|
||
|
|
||
|
# Predict checks -------------------------------------------------------------------------------------------------------
|
||
|
def test_predict_detect():
|
||
2 years ago
|
os.system(f"yolo mode=predict model={MODEL} source={ROOT / 'assets'}")
|
||
2 years ago
|
|
||
|
|
||
|
def test_predict_segment():
|
||
|
pass
|
||
|
|
||
|
|
||
|
def test_predict_classify():
|
||
|
pass
|
||
|
|
||
|
|
||
|
# Export checks --------------------------------------------------------------------------------------------------------
|
||
|
def test_export_detect_torchscript():
|
||
2 years ago
|
os.system(f'yolo mode=export model={MODEL} format=torchscript')
|
||
2 years ago
|
|
||
|
|
||
|
def test_export_segment_torchscript():
|
||
|
pass
|
||
|
|
||
|
|
||
|
def test_export_classify_torchscript():
|
||
|
pass
|