如何放置训练Yolov5的数据集?
我目前正在使用 yolov5 进行物体检测。我使用自定义数据集训练了一个模型,该数据集有 3 个类= ['汽车','摩托车','人']
我有很多与 yolov5 相关的问题。
所有自定义图像均使用 Roboflow 进行标记。
问题1:正如您从表中看到的,我的数据集混合了不同尺寸的图像。这会成为训练中的问题吗?并且假设我已经训练了模型并获得了“best.pt”。该模型能否在任何尺寸的图像/视频中有效工作?
问题 2:
此目录模型是否适合训练。即使我有“test”目录,但似乎该目录根本没有被使用。 “test”文件夹中的图像没有用。 (我知道我在问愚蠢的问题,请直接告诉我。)
如果像这样放置我的所有图像可以吗
我应该需要一个“测试”文件夹吗?
问题3: detector.py 中的“imgsz”是什么?是否对输入源进行下采样?
我在 yolo 呆了超过 3 个星期。我喜欢它,但我发现有些部分很难掌握。请针对这个问题提供建议。提前致谢。
I’m currently working on object detection using yolov5. I trained a model with a custom dataset which has 3 classes = [‘Car’,‘Motorcycle’,‘Person’]
I have many questions related to yolov5.
All the custom images are labelled using Roboflow.
question1 : As you can see from the table that my dataset has mix of images with different sizes. Will this be a problem in training? And also assume that i’ve trained the model and got ‘best.pt’. Will that model work efficiently in any dimensions of images/videos.
question 2:
Is this directory model correct for training. Even i have ‘test’ directory but it seems that the directory is not at all used. The images in the ‘test’ folder is useless. ( I know that i’m asking dumb questions, please bare with me.)
Is it ok if place all my images like this
And should i need a ‘test’ folder?
question3: What is the ‘imgsz’ in detect.py? Is it downsampling the input source?
I’ve spent more than 3 weeks in yolo. I love it but i find some parts difficult to grasp. kindly provide suggestion for this questions. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“问题1:正如您从表中看到的,我的数据集混合了不同尺寸的图像。这会是训练中的问题吗?并且还假设我已经训练了模型并获得了“best.pt”。该模型会吗?在任何尺寸的图像/视频中高效工作。”
Roboflow 的 python 包也可用于以编程方式提取图像:https://docs.roboflow.com/python
“这个目录模型是否适合训练。即使我有“test”目录,但似乎该目录根本没有被使用。 “test”文件夹中的图像是无用的(我知道我在问愚蠢的问题,请直接告诉我。)”
如果您想对测试文件夹图像运行推理以了解有关模型性能的更多信息,则确实需要一个测试文件夹。
detector.py 中的“imgsz”参数用于设置图像的高度/宽度以进行推理。您将其设置为运行 train.py 时使用的 --img 值。
例如:生成训练图像时将图像大小调整为 640 x 640?使用 (640, 640) 作为“imgsz”参数(这是默认值)。这也意味着您在运行 train.py
detect.py 时将 --img 设置为 640参数(YOLOv5 Github 存储库)
train.py 参数(YOLOv5 Github 存储库)
YOLOv5 的 Github:获得最佳训练结果的提示https://github.com/ultralytics/yolov5/wiki/Tips-for-Best-Training-Results
Roboflow 的模型制作技巧:https://docs.roboflow.com/model-tips
"question1 : As you can see from the table that my dataset has mix of images with different sizes. Will this be a problem in training? And also assume that i’ve trained the model and got ‘best.pt’. Will that model work efficiently in any dimensions of images/videos."
Roboflow's python package can also be used to extract your images programmatically: https://docs.roboflow.com/python
"Is this directory model correct for training. Even i have ‘test’ directory but it seems that the directory is not at all used. The images in the ‘test’ folder is useless. ( I know that i’m asking dumb questions, please bare with me.)"
You do need a test folder if you want to run inference against the test folder images to learn more about your model's performance.
The 'imgsz' parameter in detect.py is for setting the height/width of the images for inference. You set it at the value you used for --img when you ran train.py.
For example: Resized images to 640 by 640 when generating your images for training? Use (640, 640) for the 'imgsz' parameter (that is the default value). And that would also mean you set --img to 640 when you ran train.py
detect.py parameters (YOLOv5 Github repo)
train.py parameters (YOLOv5 Github repo)
YOLOv5's Github: Tips for Best Training Results https://github.com/ultralytics/yolov5/wiki/Tips-for-Best-Training-Results
Roboflow's Model Production Tips: https://docs.roboflow.com/model-tips