Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output predictor logs #12659

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mohammadjadallah
Copy link

@mohammadjadallah mohammadjadallah commented May 13, 2024

I found a problem in saving out logs when the predictor is running so I proposed a solution which is a way to save the logs into a text file in a separate folder called LOGS, this solution helped a lot to get the logs in a text file and uses the logs file in my project.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Introducing enhanced logging capabilities for better tracking and debugging.

📊 Key Changes

  • Imported os library to interact with the operating system.
  • Introduced a new global variable START_TIME to assist with log file management.
  • Added functionality to write inference results into a "logs.txt" file within a "LOGS" folder, supporting both new file creation and appending to an existing file.

🎯 Purpose & Impact

  • Improved Debugging: Users can now trace and review inference results over time, making it easier to debug and optimize.
  • Enhanced Tracking: The creation of a dedicated logging system allows for better tracking of model performance and operational metrics.
  • User Experience: Facilitates a smoother development and maintenance process by providing clear, accessible logs for users and developers alike, potentially reducing time spent troubleshooting. 🛠️📈

With these changes, both developers and users gain a valuable tool to enhance performance monitoring and troubleshooting, leading to more efficient and effective model operation.

I found a problem in saving out logs when the predictor is running so I proposed a solution which is a way to save the logs into a text file in a separate folder called LOGS, this solution helped a lot to get the logs in a text file and uses the logs file in my project.
Copy link

github-actions bot commented May 13, 2024

All Contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hello @mohammadjadallah, thank you for submitting an Ultralytics YOLOv8 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with ultralytics/ultralytics main branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • ✅ Verify all YOLOv8 Continuous Integration (CI) checks are passing.
  • ✅ Update YOLOv8 Docs for any new or updated features.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

See our Contributing Guide for details and let us know if you have any questions!

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.94%. Comparing base (5ac1649) to head (07ff4e1).
Report is 20 commits behind head on main.

Current head 07ff4e1 differs from pull request most recent head 19d6328

Please upload reports for the commit 19d6328 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12659      +/-   ##
==========================================
- Coverage   74.77%   70.94%   -3.84%     
==========================================
  Files         122      123       +1     
  Lines       15631    15570      -61     
==========================================
- Hits        11688    11046     -642     
- Misses       3943     4524     +581     
Flag Coverage Δ
Benchmarks 35.69% <100.00%> (+0.15%) ⬆️
GPU 37.52% <100.00%> (-5.41%) ⬇️
Tests 66.99% <100.00%> (-3.45%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mohammadjadallah
Copy link
Author

I have read the CLA Document and I sign the CLA

@Burhan-Q Burhan-Q added the enhancement New feature or request label May 13, 2024
@Burhan-Q
Copy link
Member

@mohammadjadallah thanks for opening a PR! Just a quick note, instead of importing os you can refactor your PR to use the pathlib.Path object which is already used. This is the preferred library for Ultralytics and should simplify the proposed changes. I can't say if your PR will be accepted or not, but I can tell you that making this alteration would be a requirement for acceptance.

@mohammadjadallah
Copy link
Author

@mohammadjadallah thanks for opening a PR! Just a quick note, instead of importing os you can refactor your PR to use the pathlib.Path object which is already used. This is the preferred library for Ultralytics and should simplify the proposed changes. I can't say if your PR will be accepted or not, but I can tell you that making this alteration would be a requirement for acceptance.

Thanks for your note I will do it.

@glenn-jocher
Copy link
Member

Thanks for the update and for being open to making the suggested adjustments! If you need any guidance with pathlib.Path, feel free to reach out. Looking forward to seeing the revised PR! 😊

@glenn-jocher glenn-jocher changed the title Update predictor.py Output predictor logs May 15, 2024
Copy link
Author

@mohammadjadallah mohammadjadallah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented Logging Solution with pathlib.Path

  • Utilized pathlib.Path for handling log file paths.
  • Modified the script to save logs in a separate LOGS directory.
  • Ensured the log file is correctly created and written using pathlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants