GithubHelp home page GithubHelp logo

Comments (5)

glenn-jocher avatar glenn-jocher commented on August 19, 2024

Hello!

Thank you for reporting this issue with the show_labels and show_conf parameters not functioning as expected in YOLOv8.2.25. It seems like there might be a bug affecting these settings.

As a temporary workaround, you can manually edit the image output in your script after predictions are made but before saving the image. Here's a quick example of how you might adjust the visualization manually:

model = YOLO(model_path)
results = model.predict(self.image_path)
for result in results:
    result.show_labels = False
    result.show_conf = False
result[0].save(filename=path_jpg_image)

This should help prevent labels and confidence scores from appearing in your saved images. Meanwhile, we'll look into this issue and aim for a fix in an upcoming release.

Thank you for your patience and for using Ultralytics YOLO!

from ultralytics.

paulohss avatar paulohss commented on August 19, 2024

Thanks for the response @glenn-jocher !
Unfortunately, that won't work either, just tried it =/

from ultralytics.

glenn-jocher avatar glenn-jocher commented on August 19, 2024

Hello!

Thank you for trying out the suggested workaround and for your feedback. It seems we need to investigate this issue further. We appreciate your patience while we work on a resolution. Please stay tuned for updates on this matter.

from ultralytics.

Burhan-Q avatar Burhan-Q commented on August 19, 2024

@paulohss try using result[0].save(filename=path_jpg_image, labels=False, conf=False) when you pass the show_labels or show_conf arguments during prediction, these are for use specifically with the show and save inference arguments. This is because the arguments passed to the save() method are forwarded to the plot() method.

def save(self, filename=None, *args, **kwargs):
"""Save annotated results image."""
if not filename:
filename = f"results_{Path(self.path).name}"
self.plot(save=True, filename=filename, *args, **kwargs)
return filename

If you're only looking to save the annotated images from prediction, you can skip a step and add save=True to the predict() method. This however will be output to the default runs/ directory, so if you want explicit control on where the output image is saved, use the save() method and include your plot arguments there.

I highly recommend checking out our Docs page on predict mode. There's a lot of great information there, specifically the Inference Arguments and Plotting Results sections.

from ultralytics.

github-actions avatar github-actions commented on August 19, 2024

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

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 ⭐

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.