ultralytics
ultralytics copied to clipboard
YOLOv8 inference
Search before asking
- [X] I have searched the YOLOv8 issues and discussions and found no similar questions.
Question
I am trying to infer an image folder with a yolov8 model for object detection. The code I am using is as follows
from ultralytics import YOLO
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
results = model.predict(source = "/Users/Javier/Desktop/fotos_test/makeup2_3.jpeg", save_txt=True, save_conf=True, save_crop=True, agnostic_nms=True, retina_masks=True, visualize=True, project= '/Users/Javier/Downloads') # predict on an image
And to see the results this one:
for out in results: print(out)
the error I get back is this:
No such file or directory: '/Users/Javier/Downloads/predict3/labels/makeup2_3.txt'
Any solutions?
Additional
No response
I don't see any variable named out
. If you want to see the output on the image, just pass show=True
..
Alternatively, if you're more familiar with yolov5 like usage you can just run this command in your terminal:
yolo task=detect mode=predict show=True ...
When using the python package for inference, the results are just empty, in yolov5 you could get results back and print it like so
print(results.pandas().xyxy[0])
is something similair not available for v8?
We're working on supporting it soon
I don't see any variable named
out
. If you want to see the output on the image, just passshow=True
.. Alternatively, if you're more familiar with yolov5 like usage you can just run this command in your terminal:yolo task=detect mode=predict show=True ...

@javiercolasbiddeo ohh I thought you just wanted to see the output. To save the txt files pass save_txt=True
I already wrote that, the problem is that, when i use the library the parameter project
does not give an error, but it does not give me the output. When I use the terminal, using this `!yolo task=detect
mode=predict
model=yolov8n.pt
source="https://ultralytics.com/images/bus.jpg"
save_txt=True
save_conf=True
save_crop=True
return_outputs=True
name = 'motorcycle'
`
I recive this error
@javiercolasbiddeo ohh I thought you just wanted to see the output. To save the txt files pass
save_txt=True

The results are empty, even with the tutorial case.
We're working on supporting it soon
Please ping us when its available this is what can make Yolo work in real life use cases not just for examples 💯
It is available in the current release but it's not perfect and you might experience slight slowdown. But working on much better support which'll be released soon. Meanwhile see how you can interact with predictions here: https://docs.ultralytics.com/python/
It's in the current release? I didn't see it when I recently ran it.
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
@pjelar apologies for the confusion. The feature you're looking for is not available in the current release. We are actively working on improving this to provide a seamless user experience. Thank you for your understanding.