yolov5 icon indicating copy to clipboard operation
yolov5 copied to clipboard

There is any way to find specific point in bounding box in yolov5 ?

Open SJavad opened this issue 1 year ago β€’ 8 comments

Search before asking

  • [X] I have searched the YOLOv5 issues and discussions and found no similar questions.

Question

Hi πŸ€— I trying to detect the specific object in image using yolov5. My question is. Is that possible to detect specific point in detected bounding box using yolov5?! In fact, first user click on desired point in image. So I store x, and y coordinates of specific point. Now I want when bounding box detected. The specific point be find and scaled in box. For example: Firat user click on car's driver in image, so I store x,y coord in txt file. Then I detect car in (online) image (the same car that was used for Train). Now here I want to find that specific point (location) of driver in online image. Notice that the car in online image may be rotated or flipped...

Reference Image: Screenshot_20240318_212214_Picsart.jpg

Online In Image: Picsart_24-03-18_21-10-48-195.jpg

Additional

What I tried : I try using sift and Homography method for extract features, key points and descriptors. That I scaled the point that user clicked in image (drivera coordinates) and then calculate coordinates of point in online image. But there's is a problem here: 1: the sift algorithm is too much heavy for embedded systems such as Raspberry pi or Jetson platform. 2: this method have some problems that creates some errors in system.

SJavad avatar Mar 18 '24 17:03 SJavad

@SJavad hi! πŸ‘‹

Thanks for your detailed inquiry! YOLOv5 primarily focuses on object detection, which means it's great at finding where an object (like a car) is in an image via bounding boxes. Finding a specific point within that bounding box, like the driver's position within a car, requires additional steps beyond what YOLOv5 directly offers.

For your use case, after detecting the object with YOLOv5, you might have to apply a secondary stage of processing. Since you've already tried methods like SIFT and Homography, and given their limitations on lightweight systems, you might consider simpler, less compute-intensive approaches tailored to your specific application. For instance, if the specific points of interest have unique color features, simple color segmentation could be leveraged. Alternatively, if the points maintain a relative position within the bounding box that's consistent across detections, calculating the point's new location based on the bounding box's proportions could be a lightweight solution.

Unfortunately, YOLOv5 does not natively support the direct detection of points within an object beyond the bounding box detection. I recommend focusing on custom post-processing methods suited to the constraints of your hardware and the specifics of your task.

If you have more questions or need further clarification, feel free to ask. Happy coding!

glenn-jocher avatar Mar 18 '24 19:03 glenn-jocher

@SJavad hi! πŸ‘‹

Thanks for your detailed inquiry! YOLOv5 primarily focuses on object detection, which means it's great at finding where an object (like a car) is in an image via bounding boxes. Finding a specific point within that bounding box, like the driver's position within a car, requires additional steps beyond what YOLOv5 directly offers.

For your use case, after detecting the object with YOLOv5, you might have to apply a secondary stage of processing. Since you've already tried methods like SIFT and Homography, and given their limitations on lightweight systems, you might consider simpler, less compute-intensive approaches tailored to your specific application. For instance, if the specific points of interest have unique color features, simple color segmentation could be leveraged. Alternatively, if the points maintain a relative position within the bounding box that's consistent across detections, calculating the point's new location based on the bounding box's proportions could be a lightweight solution.

Unfortunately, YOLOv5 does not natively support the direct detection of points within an object beyond the bounding box detection. I recommend focusing on custom post-processing methods suited to the constraints of your hardware and the specifics of your task.

If you have more questions or need further clarification, feel free to ask. Happy coding!

@glenn-jocher Hi, Thank you so much for your response 😊 Thank you for your explanation, I leave this issue open for someone else to suggest a solution πŸ–οΈπŸŒΈ

SJavad avatar Mar 18 '24 23:03 SJavad

@SJavad You're welcome! 😊 If anyone else in the community has ideas or alternative solutions, please feel free to share. This is a great example of collaborative problem-solving. Good luck with your project, and don't hesitate to reach out if you have further questions or insights to share! 🌟

glenn-jocher avatar Mar 19 '24 06:03 glenn-jocher

@glenn-jocher hi again is that possible to do this task with yolov8-keypoiny detection ?

SJavad avatar Mar 31 '24 11:03 SJavad

@SJavad Hi again! πŸ‘‹

Yes, YOLOv8 introduces capabilities for keypoint detection, which could potentially be used for tasks like identifying specific points within objects. However, it's important to note that YOLOv8's keypoint detection would still require appropriate training data, where the keypoints of interest are labeled in your dataset.

For detecting a specific point like a car's driver, you would need to have your training dataset annotated with these keypoints (e.g., driver's position) across various conditions.

This can significantly enhance the model's ability to recognize and predict the position of such specific points within detected objects in new images.

Happy experimenting with YOLOv8 keypoint detection! Let me know how it goes. 😊

glenn-jocher avatar Mar 31 '24 16:03 glenn-jocher

@SJavad Hi again! πŸ‘‹

Yes, YOLOv8 introduces capabilities for keypoint detection, which could potentially be used for tasks like identifying specific points within objects. However, it's important to note that YOLOv8's keypoint detection would still require appropriate training data, where the keypoints of interest are labeled in your dataset.

For detecting a specific point like a car's driver, you would need to have your training dataset annotated with these keypoints (e.g., driver's position) across various conditions.

This can significantly enhance the model's ability to recognize and predict the position of such specific points within detected objects in new images.

Happy experimenting with YOLOv8 keypoint detection! Let me know how it goes. 😊

@glenn-jocher Thanks again for your advice πŸŒΈπŸ–οΈ Of course, I will share it if there is any success ☺️

SJavad avatar Mar 31 '24 17:03 SJavad

@SJavad You're very welcome! 🌼 Looking forward to hearing about your progress and any successes you achieve. Remember, the journey is as important as the destination. Happy coding and experimenting! πŸ˜„πŸ‘

glenn-jocher avatar Mar 31 '24 23:03 glenn-jocher

πŸ‘‹ 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 May 01 '24 00:05 github-actions[bot]