ultralytics icon indicating copy to clipboard operation
ultralytics copied to clipboard

YOLOv8 inference

Open javiercolasbiddeo opened this issue 1 year ago • 9 comments

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

javiercolasbiddeo avatar Jan 12 '23 18:01 javiercolasbiddeo

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 ...

AyushExel avatar Jan 12 '23 18:01 AyushExel

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?

tank-o avatar Jan 12 '23 19:01 tank-o

We're working on supporting it soon

AyushExel avatar Jan 12 '23 19:01 AyushExel

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 ...
image Yes, but my folder is empty, there is no txt files.

javiercolasbiddeo avatar Jan 13 '23 09:01 javiercolasbiddeo

@javiercolasbiddeo ohh I thought you just wanted to see the output. To save the txt files pass save_txt=True

AyushExel avatar Jan 13 '23 10:01 AyushExel

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 image

@javiercolasbiddeo ohh I thought you just wanted to see the output. To save the txt files pass save_txt=True

javiercolasbiddeo avatar Jan 13 '23 10:01 javiercolasbiddeo

Bildschirm­foto 2023-01-13 um 13 22 29

The results are empty, even with the tutorial case.

JakobStadlhuber avatar Jan 13 '23 12:01 JakobStadlhuber

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 💯

mrmarten avatar Jan 14 '23 17:01 mrmarten

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/

AyushExel avatar Jan 14 '23 18:01 AyushExel

It's in the current release? I didn't see it when I recently ran it.

pjelar avatar Feb 22 '23 08:02 pjelar

👋 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 ⭐

github-actions[bot] avatar Mar 25 '23 00:03 github-actions[bot]

@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.

pderrenger avatar Nov 16 '23 03:11 pderrenger