• QueryDet项目实战应用


    刚刚接触detectron2框架,总的来讲该框架由Facebook开源,质量还是非常不错的,值得学习。今天就对安装和测试遇到的一些问题进行整理和总结。后期会持续更新。

    Detectron2安装
    Detectron2项目链接:https://github.com/facebookresearch/detectron2
    官方安装教程:https://github.com/facebookresearch/detectron2/blob/main/INSTALL.md

    Requirements
    Python ≥ 3.7 (本实验在Ubuntu16.04下进行,使用Python3.7)
    Pytorch ≥ 1.8 对应版本的 torchvision(本实验安装Pytorch 1.6,torchvision 0.7)
    CUDA 11.3 (请选择与Pytorch匹配的cudatoolkit版本,以便成功安装框架)
    GCC >= 4.9(这个是C/C++编译环境的要求,如果不对,在编译过程基本就会失败)

    环境安装
    anaconda创建环境
    conda create -n detectron2 python=3.7
    conda activate detectron2
    安装pytorch cuda11.3
    conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

    #测试一下
    import torch, torchvision
    print(torch.version, torch.cuda.is_available())
    安装其他依赖项
    pip install cython pyyaml5.1
    pip install opencv-python
    3.4.2
    pip install cython

    fvcore 本实验安装的是下面版本,也可以参考官方安装教程安装其他版本:https://github.com/facebookresearch/fvcore/

    pip install fvcore==0.1.1.post20200716

    安装pycocotools,如果下面代码运行报错,可以参考链接进行安装:https://blog.csdn.net/xiongzai2016/article/details/106855544

    pip install -U ‘git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI’
    安装detectron2

    从本地克隆安装

    git clone https://github.com/facebookresearch/detectron2.git
    python -m pip install -e detectron2
    这样下载的detectron2是最新版本,由于官方安装文档中要求PyTorch ≥ 1.8 ,所以安装的时候会报错。可以访问detectron2的历史版本链接:https://github.com/facebookresearch/detectron2/releases
    根据安装的PyTorch和cuda版本来安装对应版本的detectron2,下面是PyTorch1.6对应的安装命令行:

    python -m pip install detectron2==0.4 -f
    https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.6/index.html

  • 相关阅读:
    小谈设计模式(19)—备忘录模式
    数字图像处理(十二)最大熵算法
    【C#】文件的移动
    shell脚本介绍
    强化训练:day4
    智能交通技术专利态势分析
    ISP比普通的静态代理相比有什么优势?
    华为OD机考算法题:简单的自动曝光
    LIO-SAM 详读代码笔记 -- 4.featureExtraction
    C# net core中的过滤器(Filter)使用及跳过过滤器
  • 原文地址:https://blog.csdn.net/weixin_52201738/article/details/126329412