美文网首页
CenterNet目标检测技术试验

CenterNet目标检测技术试验

作者: RunningJiang | 来源:发表于2020-11-04 21:07 被阅读0次

项目地址https://github.com/xingyizhou/CenterNet

一、配置环境

基础环境 ubuntu16.04 cuda9.2 gtx1080ti

  • PYTHON虚拟环境搭建
conda create -n CenterNet python=3.6
  • 安装pytorch版本0.4.1
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ #设置清华源
conda install pytorch=0.4.1 cuda92 #安装对应版本的torch
conda install torchvision
  • 修改functional.py中的torch.batch_norm函数中的torch.backends.cudnn.enabled 为False
  • 安装requirements.txt中的依赖项
    遇到问题

    安装numba的时候遇到的问题,看了下是LLVM的版本不对。从官网选择对应的LLVM版本https://github.com/llvm/llvm-project/releases下载。一定要下载10.0.1 这个版本,我下载了11.0.1不行
    下载之后解压,然后设置LLVM_CONFIG路劲
    export LLVM_CONFIG=/home/nemo/software/package/clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04/bin/llvm-config
  • 编译
cd $CenterNet_ROOT/src/lib/models/networks/DCNv2
./make.sh

二、运行测试代码

  • 下载模型
    https://github.com/xingyizhou/CenterNet/blob/master/readme/MODEL_ZOO.md
    放到models目录下
  • 测试

    直接下载太慢了,这里复制了下载地址,然后用迅雷下载很快就下载好了。下载之后把模型文件放到指定的目录下就可以了。
    python demo.py ctdet --demo /home/nemo/DeepLearningFramework/CenterNet/images/33823288584_1d21cf0a26_k.jpg --load_model ../models/ctdet_coco_dla_2x.pth

相关文章

网友评论

      本文标题:CenterNet目标检测技术试验

      本文链接:https://www.haomeiwen.com/subject/mpjypktx.html