-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
How to convert files annotated with linestrip in labelme to yolo #68
Comments
@DJohn1211 you can convert linestrip annotations from Labelme to YOLO format by calculating the bounding box coordinates from the linestrip points. The Ultralytics documentation at https://docs.ultralytics.com provides detailed instructions for this conversion. Let me know if you need further assistance! |
Hi!I am very excited to receive your reply, but I still don't quite understand what you said about calculating the coordinates of the bounding box based on the underlined points. I couldn't find any relevant content in the website you provided. If you could give me an example of converting x1y1 x2y2 … xnyn to yolo, or could you please provide me with a file? I would greatly appreciate it. Finally, I look forward to your reply. |
@DJohn1211 certainly! You can calculate the bounding box coordinates (x, y, width, height) from the linestrip points by finding the minimum and maximum x and y coordinates, and then computing the center and dimensions of the bounding box. Unfortunately, I'm not able to provide you with a specific file, but you can refer to the Ultralytics documentation for general conversion guidance. Let me know if you have further questions! |
@DJohn1211 YOLOv8 should be able to recognize the line labels as you have annotated them. For the xy label conversion, you can use the center (cx, cy) and dimensions (width, height) of the bounding box calculated from the linestrip points. This should enable YOLOv8 to properly detect the line. Let me know if you have further inquiries or need assistance with anything else! |
thank you!!! |
@DJohn1211 you're welcome! If you have any more questions in the future, feel free to ask. Good luck with your project! 😊 |
Hello, |
Hello! Training YOLOv8 with Linestrip annotations involves treating the linestrips as objects with bounding boxes. It's not exactly like keypoint detection, which typically involves predicting specific points. For Linestrip, you would define the bounding box around the entire strip. Ensure your annotations are converted to the YOLO format (center x, center y, width, height) as discussed earlier. If you need more specific guidance on setting up your training configuration, feel free to ask. Good luck! |
Thank you for your reply. What I did was convert the line strip into two points by taking the first point and the second point to train YOLOv8. Is this also correct? I also ensured that the two points are normalized. Thank you for your feedback. |
Hello! Using just the first and last points of the linestrip to define a bounding box is a valid approach, especially if the line is relatively straight. Normalizing these points, as you've done, is crucial for maintaining consistency with the YOLO format. Keep in mind, however, that this method might not capture the full essence of more complex or curved linestrips. If your linestrips are generally straight, your method should work well. If you encounter more complex shapes, consider using the bounding box encompassing all points for better accuracy. Let me know if you need further assistance! 😊 |
Hi,I think you can use labelme or labelme with sam (segment anything model). And then, you can convert absolute coordinates to relative coordinates. YOLOv8 could be trained with these coordinates. |
@DJohn1211 hello, to train YOLOv8 with Linestrip annotations, convert the linestrip to bounding boxes and use the YOLO format (center x, center y, width, height). This approach differs from keypoint detection. Ensure your annotations are correctly formatted and normalized. If you need further assistance, feel free to ask. |
thanks,man!!! |
You're welcome! If you have any more questions or need further assistance, feel free to ask. |
In normal circumstances, when we use rectangular boxes to label, we will obtain x1y1 and x2y2, convert the corresponding coordinates to cx cy w h. If I use linestrip to obtain the coordinate xy, how should I convert it to the corresponding coordinate. The corresponding image is as follows.
The text was updated successfully, but these errors were encountered: