-
-
Notifications
You must be signed in to change notification settings - Fork 16k
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
能不能减少标注的工作量实现自动标注 #12858
Comments
👋 Hello @2375963934a, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
@2375963934a 当然可以!使用已训练好的模型来自动生成标签是一种增强模型精度的有效方法。简单来说,你可以这么做:
在YOLOv5中,你可以通过 记得,持续改进数据标注的质量是提升模型性能的关键!🚀 |
我是想先少量标注训练出一个模型,在用模型去推理图像让他生成json文件继续训练,我用的是yolov5m-seg来进行训练的,但是不知道怎么生成json文件 |
@2375963934a 您好!使用您描述的方法来迭代提高模型精度非常有效。对于生成JSON文件部分,您可以考虑使用YOLOv5的推理输出,然后编写简单的脚本将这些输出转换为您需要的JSON格式。 以YOLOv5的标准输出为例,您可以通过如下步骤进行:
以下是一个简单的代码示例,展示如何将假设的检测输出转换为JSON格式: import json
# 假设的检测结果
detections = [
{"class": 0, "confidence": 0.98, "box": [0.1, 0.2, 0.3, 0.4]},
{"class": 1, "confidence": 0.75, "box": [0.4, 0.3, 0.2, 0.1]}
]
# 将检测结果写入JSON文件
with open("detections.json", "w") as f:
json.dump(detections, f) 请根据您的具体输出结果和需求调整此脚本。希望这能帮助您实现目标!😄 |
我想要的是推理结果直接输出json文件,就像我在labelme中标注过的图片一样,可以对应推理图片在labelme中打开出现多边形框,实现像我标注过这种推理图片一样 |
|
@2375963934a,您好!👋 要直接从YOLOv5推理结果生成Labelme风格的JSON文件,您需要自己编写一段脚本来转换格式。基本步骤是将每个检测的边界框或多边形框转换成Labelme的JSON格式。这通常包括类别名称、点坐标、形状类型等。 以下是一个简化的Python代码示例,演示了如何将假设的YOLO检测结果转换为Labelme支持的JSON格式: import json
# 假设的YOLO检测结果
detections = [
{"class": "person", "confidence": 0.98, "box": [0.1, 0.2, 0.3, 0.4]},
{"class": "car", "confidence": 0.75, "box": [0.4, 0.3, 0.2, 0.1]}
]
# 转换为Labelme格式
labelme_shapes = []
for det in detections:
x1, y1, x2, y2 = det["box"]
points = [[x1, y1], [x2, y1], [x2, y2], [x1, y2]]
shape = {
"label": det["class"],
"points": points,
"group_id": None,
"shape_type": "rectangle",
"flags": {}
}
labelme_shapes.append(shape)
labelme_format = {
"version": "4.5.6",
"flags": {},
"shapes": labelme_shapes,
"imagePath": "path/to/your/image.jpg",
"imageData": None,
"imageHeight": 1080,
"imageWidth": 1920
}
# 写入到文件
with open("result.json", "w") as f:
json.dump(labelme_format, f, ensure_ascii=False, indent=2) 请注意,您需要根据您的具体需求调整代码,比如处理不同的形状类型或者从实际的YOLO输出中抽取数据。希望这个示例能帮到您!😊 |
你的意思是想左脚踩右脚直接上天? |
哈哈, 看起来您是在寻找一个挑战性的解决方案!😄 如果有什么具体问题或需求,请随时详细告诉我们,我们很乐意帮助你找到解决方案。 |
👋 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:
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 ⭐ |
能不能用训练好的模型检测图像时生成一个对应标签的json文件然后将检测的图像和对应生成的json文件去进行调整然后重新训练提高模型的精度
The text was updated successfully, but these errors were encountered: