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

yolov5_counting_object #11567

Closed
wants to merge 50 commits into from
Closed

yolov5_counting_object #11567

wants to merge 50 commits into from

Conversation

Lworakan
Copy link

@Lworakan Lworakan commented May 22, 2023

🤖 Generated by Copilot at d7ced9b

Summary

🎥📊📈

This pull request enhances the segmentation inference for video streams from webcams. It adds features to display and print the object detection statistics, to mask out the irrelevant background area, and to count the objects inside a predefined rectangle area. It also adds new files to run the inference on two different cameras and to use a different counting logic. It modifies the files segment/predict.py and utils/plots.py.

To segment objects from a cam
We copied and tweaked predict.py
We added some stats
And masked out the flats
With a black rectangle in plot_one_box()

Walkthrough

  • Add new files for running segmentation inference on two different cameras and counting objects inside a predefined rectangle area (link, link)
  • Modify segment/predict.py to import math module, define text variables, initialize and update statistics, and display object detection text on video frames (link, link, link, link)
  • Modify utils/plots.py to draw a black rectangle on the image to cover the background area (link)
  • Add an empty line in utils/plots.py (link)

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Introducing new Jupyter notebook and Python scripts for object detection with YOLOv5, including advanced features.

📊 Key Changes

  • Added a Jupyter notebook Copy_of_COCO2YOLO_1st.ipynb with extensive code cells for various preprocessing tasks, dataset handling, and utility functions related to YOLOv5 usage.
  • Created new Python scripts predict_line_cam1.py, predict_line_cam2.py, and streamlit_test2.py to support different use cases in object detection and data processing.

🎯 Purpose & Impact

  • The Jupyter notebook provides a detailed workflow and utility functions for users wanting to use YOLOv5 for custom object detection tasks - from modifying image formats and resolution to evaluating dataset splits and bounding box conversions.
  • The Python scripts extend the capabilities of YOLOv5 to different environments and showcase how to implement YOLOv5 in various scenarios, like webcam input, video frame processing, or web application deployment. This versatility makes it easier for developers and researchers to adopt YOLOv5 in their projects.
  • Improvements in the plots.py script enhance the visualization aspect during inference, adding to the user experience when using YOLOv5 for object detection.

Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Lworakan and others added 4 commits May 21, 2023 21:01
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
@Lworakan Lworakan marked this pull request as draft May 22, 2023 06:54
@Lworakan Lworakan marked this pull request as ready for review May 22, 2023 06:55
Copy link
Contributor

@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 @19xx47, thank you for submitting a YOLOv5 🚀 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/yolov5 master 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 master locally.
  • ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
  • ✅ 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

@Lworakan Lworakan requested a review from Taspol May 22, 2023 07:22
Copy link

@Taspol Taspol left a comment

Choose a reason for hiding this comment

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

Wow, so amazing

Lworakan and others added 12 commits May 22, 2023 14:56
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
Signed-off-by: Worakan Lasudee <78127819+19xx47@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap.

We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved.

For additional resources and information, please see the links below:

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label Oct 3, 2023
@github-actions github-actions bot closed this Nov 2, 2023
@glenn-jocher
Copy link
Member

@19xx47 thanks for the pull request! It's great to see your enthusiasm for improving YOLOv5 segmentation for video streams. We appreciate your effort in enhancing the object detection statistics, adding masking for the background area, and implementing object counting within a defined region. Your contributions to segment/predict.py and utils/plots.py are valuable.

The changes to the code look promising, and I'll ensure the team reviews and tests them thoroughly. If there's anything else you'd like to add or if you need further assistance, feel free to reach out. Thank you again for your dedication to the YOLOv5 project!

To learn more about how to contribute effectively to YOLOv5, have a look at our Contributing Guide.

We appreciate your support and the time you've invested in making YOLOv5 even better!

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

Successfully merging this pull request may close these issues.

None yet

3 participants