ultralytics 8.0.41 TF SavedModel and EdgeTPU export (#1034)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Noobtoss <96134731+Noobtoss@users.noreply.github.com>
Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
This commit is contained in:
Glenn Jocher
2023-02-20 01:27:28 +01:00
committed by GitHub
parent 4b866c9718
commit f6e393c1d2
64 changed files with 604 additions and 351 deletions

View File

@ -30,7 +30,7 @@ def test_train_seg():
def test_train_cls():
run(f'yolo train classify model={CFG}-cls.yaml data=mnist160 imgsz=32 epochs=1')
run(f'yolo train classify model={CFG}-cls.yaml data=imagenet10 imgsz=32 epochs=1')
# Val checks -----------------------------------------------------------------------------------------------------------
@ -43,7 +43,7 @@ def test_val_segment():
def test_val_classify():
run(f'yolo val classify model={MODEL}-cls.pt data=mnist160 imgsz=32')
run(f'yolo val classify model={MODEL}-cls.pt data=imagenet10 imgsz=32')
# Predict checks -------------------------------------------------------------------------------------------------------

View File

@ -74,8 +74,14 @@ def test_segment():
def test_classify():
overrides = {'data': 'mnist160', 'model': 'yolov8n-cls.yaml', 'imgsz': 32, 'epochs': 1, 'batch': 64, 'save': False}
CFG.data = 'mnist160'
overrides = {
'data': 'imagenet10',
'model': 'yolov8n-cls.yaml',
'imgsz': 32,
'epochs': 1,
'batch': 64,
'save': False}
CFG.data = 'imagenet10'
CFG.imgsz = 32
CFG.batch = 64
# YOLO(CFG_SEG).train(**overrides) # works

View File

@ -154,7 +154,7 @@ def test_predict_callback_and_setup():
bs = [predictor.dataset.bs for _ in range(len(path))]
predictor.results = zip(predictor.results, im0s, bs)
model = YOLO('yolov8n.pt')
model = YOLO(MODEL)
model.add_callback('on_predict_batch_end', on_predict_batch_end)
dataset = load_inference_source(source=SOURCE, transforms=model.transforms)
@ -169,9 +169,16 @@ def test_predict_callback_and_setup():
def test_result():
model = YOLO('yolov8n-seg.pt')
img = str(ROOT / 'assets/bus.jpg')
res = model([img, img])
res = model([SOURCE, SOURCE])
res[0].numpy()
res[0].cpu().numpy()
resimg = res[0].visualize(show_conf=False)
print(resimg)
model = YOLO('yolov8n.pt')
res = model(SOURCE)
res[0].visualize()
model = YOLO('yolov8n-cls.pt')
res = model(SOURCE)
res[0].visualize()