mmdetection的使用

1、进入mmdetection源码地址https://github.com/open-mmlab/mmdetection
2、按照文件中的get_started.md的步骤安装:

  1. 创建虚拟环境open-mmlab并激活
    Create a conda virtual environment and activate it.

    conda create -n open-mmlab python=3.7 -y
    conda activate open-mmlab
    
  2. 安装PyTorch和torchvision
    Install PyTorch and torchvision following the official instructions, e.g.,

    conda install pytorch torchvision -c pytorch
    

    Note: Make sure that your compilation CUDA version and runtime CUDA version match.
    You can check the supported CUDA version for precompiled packages on the PyTorch website.

    E.g.1 CUDA10.1,PyTorch1.5版本
    If you have CUDA 10.1 installed under /usr/local/cuda and would like to install
    PyTorch 1.5, you need to install the prebuilt PyTorch with CUDA 10.1.

    conda install pytorch cudatoolkit=10.1 torchvision -c pytorch
    

    E.g. 2 CUDA9.2,PyTorch1.3.1版本
    If you have CUDA 9.2 installed under /usr/local/cuda and would like to install
    PyTorch 1.3.1., you need to install the prebuilt PyTorch with CUDA 9.2.

    conda install pytorch=1.3.1 cudatoolkit=9.2 torchvision=0.4.2 -c pytorch
    

    If you build PyTorch from source instead of installing the prebuilt pacakge,
    you can use more CUDA versions such as 9.0.

  3. 安装mmcv-full,把{cu_version} and {torch_version} 替换为对应版本
    Install mmcv-full, we recommend you to install the pre-build package as below.

    pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
    

    Please replace {cu_version} and {torch_version} in the url to your desired one. For example, to install the latest mmcv-full with CUDA 11 and PyTorch 1.7.0, use the following command:

    pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
    

    See here for different versions of MMCV compatible to different PyTorch and CUDA versions.
    Optionally you can choose to compile mmcv from source by the following command
    下载github源码

    git clone https://github.com/open-mmlab/mmcv.git
    cd mmcv
    MMCV_WITH_OPS=1 pip install -e .  # package mmcv-full will be installed after this step
    cd ..
    

    Or directly run

    pip install mmcv-full
    
  4. Clone the MMDetection repository.

    git clone https://github.com/open-mmlab/mmdetection.git
    cd mmdetection
    
  5. 安装requirements
    Install build requirements and then install MMDetection.

    pip install -r requirements/build.txt
    pip install -v -e .  # or "python setup.py develop"
    

6.快速开始,进入demo文件夹下的inference_demo.ipynb,安装所需模型的预训练模型,运行测试。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值