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

Fix increment +=2 bug in object_counter.py #9998

Merged
merged 2 commits into from Apr 13, 2024

Conversation

mianusman618
Copy link
Contributor

@mianusman618 mianusman618 commented Apr 11, 2024

In case of count by "line points" its adding 2 in counter by each passing object instead of adding 1 in value. Updated to resolve the issue. Issue raised on docs page as well. Video Reference for false output:- https://bit.ly/obj_count_wrong

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced accuracy in object counting within counting regions.

πŸ“Š Key Changes

  • Corrected the increment of in count in the class-wise count from 2 to 1 for object tracking.

🎯 Purpose & Impact

  • Purpose: This change aims to fix an error in the counting logic where objects entering a specified region were being counted twice instead of just once. By adjusting the increment from 2 to 1, the counting now accurately reflects the number of objects entering the region.
  • Impact: Users deploying object counting solutions will experience more precise and reliable count metrics, leading to improved analytics and decision-making based on the count data. This can significantly enhance the utility of applications in various sectors, including retail, transportation, and surveillance, by providing more accurate people or object flow statistics. πŸ“ˆ

In case of count by "line points" its adding 2 in counter by each passing object instead of adding 1 in value. Updated to resolve the issue. Issue raised on docs page as well.
Video Reference for false output:- https://bit.ly/obj_count_wrong
Copy link

github-actions bot commented Apr 11, 2024

CLA Assistant Lite bot All Contributors have signed the CLA. βœ…

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 @mianusman618, 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!

@mianusman618
Copy link
Contributor Author

I have read the CLA Document and I sign the CLA

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 73.76%. Comparing base (42416bc) to head (ede692c).

Files Patch % Lines
ultralytics/solutions/object_counter.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9998      +/-   ##
==========================================
- Coverage   78.99%   73.76%   -5.23%     
==========================================
  Files         121      121              
  Lines       15332    15332              
==========================================
- Hits        12111    11310     -801     
- Misses       3221     4022     +801     
Flag Coverage Ξ”
Benchmarks 35.87% <0.00%> (-0.15%) ⬇️
GPU ?
Tests 71.13% <0.00%> (-3.62%) ⬇️

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.

@mianusman618
Copy link
Contributor Author

I have read the CLA Document and I sign the CLA

@glenn-jocher
Copy link
Member

@RizwanMunawar is this PR good to merge?

Copy link
Member

@RizwanMunawar RizwanMunawar left a comment

Choose a reason for hiding this comment

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

@mianusman618 Thanks for fixing the minor bug :)

@glenn-jocher yes, we can merge this PR :)

Thanks

@Burhan-Q Burhan-Q added bug Something isn't working fixed Bug has been resolved labels Apr 12, 2024
@mianusman618
Copy link
Contributor Author

Thank you for acknowledging the bug fix!! Contributing to such a valuable resource is truly satisfactory.
Really appreciate the outstanding efforts made to make YOLO simpler for everyone. Kudos to @glenn-jocher and team.

@glenn-jocher
Copy link
Member

Thank you so much for your kind words and contribution! πŸ™Œ It's wonderful to have such supportive and engaged community members. Your efforts help us all move forward together. Keep up the great work! πŸ‘

@glenn-jocher glenn-jocher changed the title Update object_counter.py Fix increment 2 bug in object_counter.py Apr 13, 2024
@glenn-jocher glenn-jocher changed the title Fix increment 2 bug in object_counter.py Fix increment +=2 bug in object_counter.py Apr 13, 2024
@glenn-jocher glenn-jocher merged commit e2700e7 into ultralytics:main Apr 13, 2024
10 checks passed
@glenn-jocher
Copy link
Member

@mianusman618 PR merged, thank you for this fix and please let us know if you spot any other problems :)

hmurari pushed a commit to hmurari/ultralytics that referenced this pull request Apr 17, 2024
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Bug has been resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants