Fix *.txt source inference dataloader (#4468)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
3acead7e79
commit
c659c0fa7b
2 changed files with 11 additions and 1 deletions
|
|
@ -49,6 +49,16 @@ def test_predict_dir():
|
|||
model(source=ASSETS, imgsz=32)
|
||||
|
||||
|
||||
def test_predict_txt():
|
||||
# Write a list of sources to a txt file
|
||||
txt_file = TMP / 'sources.txt'
|
||||
with open(txt_file, 'w') as f:
|
||||
for x in [ASSETS / 'bus.jpg', ASSETS / 'zidane.jpg']:
|
||||
f.write(f'{x}\n')
|
||||
model = YOLO(MODEL)
|
||||
model(source=txt_file, imgsz=640)
|
||||
|
||||
|
||||
def test_predict_img():
|
||||
model = YOLO(MODEL)
|
||||
seg_model = YOLO(WEIGHTS_DIR / 'yolov8n-seg.pt')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue