YOLOV5视觉检测train.py运行完为什么目录里没有想要的结果图

这是在网上找的帖子博主运行的结果

img

img


这是我运行后,目录里面也没有想要的结果图

img

【相关推荐】



  • 你可以参考下这个问题的回答, 看看是否对你有帮助, 链接: https://ask.csdn.net/questions/7399264
  • 这篇博客也不错, 你可以看下YOLOV5训练代码train.py注释与解析
  • 您还可以看一下 白勇老师的YOLOv5(PyTorch)目标检测:原理与源码解析课程中的 train.py代码解析2小节, 巩固相关知识点
  • 除此之外, 这篇博客: 2021SC@SDUSC山东大学软件学院软件工程应用与实践——yolov5代码分析——第九篇——val.py(1)中的 设置opt参数 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
    def parse_opt():
        parser = argparse.ArgumentParser()
        parser.add_argument('--data', type=str, default='data/coco128.yaml', help='dataset.yaml path')
        parser.add_argument('--weights', nargs='+', type=str, default='yolov5s.pt', help='model.pt path(s)')
        parser.add_argument('--batch-size', type=int, default=32, help='batch size')
        parser.add_argument('--imgsz', '--img', '--img-size', type=int, default=640, help='inference size (pixels)')
        parser.add_argument('--conf-thres', type=float, default=0.001, help='confidence threshold')
        parser.add_argument('--iou-thres', type=float, default=0.6, help='NMS IoU threshold')
        parser.add_argument('--task', default='val', help='train, val, test, speed or study')
        parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
        parser.add_argument('--single-cls', action='store_true', help='treat as single-class dataset')
        parser.add_argument('--augment', action='store_true', help='augmented inference')
        parser.add_argument('--verbose', action='store_true', help='report mAP by class')
        parser.add_argument('--save-txt', action='store_true', help='save results to *.txt')
        parser.add_argument('--save-hybrid', action='store_true', help='save label+prediction hybrid results to *.txt')
        parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels')
        parser.add_argument('--save-json', action='store_true', help='save a COCO-JSON results file')
        parser.add_argument('--project', default='runs/val', help='save to project/name')
        parser.add_argument('--name', default='exp', help='save to project/name')
        parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
        parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference')
        opt = parser.parse_args()
        opt.save_json |= opt.data.endswith('coco.yaml')
        opt.save_txt |= opt.save_hybrid
        opt.data = check_yaml(opt.data)  # check YAML
        print_args(FILE.stem, opt)
        return opt

    data: 数据集配置文件地址 包含数据集的路径、类别个数、类名、下载地址等信息

    weights: 模型的权重文件地址 weights/yolov5s.pt

    batch_size: 前向传播的批次大小 默认32

    imgsz: 输入网络的图片分辨率 默认640

    conf-thres: object置信度阈值 默认0.25

    iou-thres: 进行NMS时IOU的阈值 默认0.6

    task: 设置测试的类型 有train, val, test, speed or study几种 默认val

    device: 测试的设备

    single-cls: 数据集是否只用一个类别 默认False

    augment: 测试是否使用TTA Test Time Augment 默认False

    verbose: 是否打印出每个类别的mAP 默认False
       
    save-txt: traditional auto-labelling

    save-hybrid: save hybrid autolabels, combining existing labels with new predictions before NMS (existing predictions given confidence=1.0 before NMS.

    save-conf: add confidences to any of the above commands

    save-json: 是否按照coco的json格式保存预测框,并且使用cocoapi做评估(需要同样coco的json格式的标签) 默认

    False

    project: 测试保存的源文件 默认runs/test

    name: 测试保存的文件地址 默认exp  保存在runs/test/exp下

    exist-ok: 是否存在当前文件 默认False 一般是 no exist-ok 连用  所以一般都要重新创建文件夹

    half: 是否使用半精度推理 默认False


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^