zoukankan      html  css  js  c++  java
  • 今天晚上的过程

    因为我之前好多包版本有问题,我反复弄了两边,最后我确定没问题了就去跑demo,然后发现。

    官方给的demo

    from mmdet.apis import init_detector, inference_detector
    
    config_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
    # download the checkpoint from model zoo and put it in `checkpoints/`
    # url: https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth
    checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'
    device = 'cuda:0'
    # init a detector
    model = init_detector(config_file, checkpoint_file, device=device)
    # inference the demo image
    inference_detector(model, 'demo/demo.jpg')
    

    这里面没存储图片啊,汗
    然后我从网上找的demo

    from mmdet.apis import init_detector, inference_detector, show_result
    import mmcv
    
    config_file = '../configs/retinanet_r50_fpn_1x.py'
    checkpoint_file = '../checkpoints/retinanet_r50_fpn_1x_20181125-7b0c2548.pth'
    
    # build the model from a config file and a checkpoint file
    model = init_detector(config_file, checkpoint_file, device='cuda:0')
    
    # test a single image and show the results
    img = 'demo.jpg'  # or img = mmcv.imread(img), which will only load it once
    result = inference_detector(model, img)
    # visualize the results in a new window
    show_result(img, result, model.CLASSES)
    # or save the visualization results to image files
    show_result(img, result, model.CLASSES, out_file='result.jpg')
    

    他这个是18年写的程序,mmdet更新以后都吗show_result这个函数删了,我拿这个model.show_result调用才跑起来,可能就是因为这样才一直报错。然后我把人家的一行代码删了终于出结果了,就是准确率很低,可能是demo程序不行,因为我返工了两边,所以把服务器的数据集删了,我先上传着,先睡了,明天再试试训练。

  • 相关阅读:
    谷歌将用QUIC传输层技术加速互联网
    无人自助洗车机漏洞
    什么是区块链,为什么它越来越受欢迎
    域名Whois数据和隐私是最大风险
    什么原因?全球许多网络提供商推迟部署IPv6
    FFT/NTT复习笔记&多项式&生成函数学习笔记Ⅱ
    C#中读写INI配置文件
    C#读取和导出EXCEL类库(可操作多个SHEET)
    Javascript刷新页面的几种方法
    用C#抓取AJAX页面的内容
  • 原文地址:https://www.cnblogs.com/wenwenjiejie/p/15328267.html
Copyright © 2011-2022 走看看