github上有官方的安装方法,链接如下:
https://github.com/open-mmlab/mmdetection/blob/master/docs/INSTALL.md
其中
pip install "git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI"
这一步安装cocoapi有问题。一个是github下载可能会太慢,其次原路径下是找不到pip安装所需要的setup.py的,该文件在原路径中的“PythonAPI”中
我使用的解决办法如下:
1.下载源码(为了速度在gitee上建立了镜像)
conda activate mmdetection #激活环境
git clone -q https://gitee.com/kezis/cocoapi_python_v2 /tmp/pip-temp #clone源码到任意文件夹
cd /tmp/pip-temp/PythonAPI
2.通过setup.py安装
python setup.py build
python setup.py install