FAIROpen source target detection frameworkDetectron2, based onPytorch。 It trains faster than ever, has more functions, and supports more models than ever before. For example, the early modelFaster R-CNN，Mask R-CNN，RetinaNet，DensePoseIn addition to the support of other models, such asCascade R-NN，Panoptic FPN，TensorMaskWait, and it’s solved beforePytorchThe criticism that production is difficult to deploy. So I can’t wait to have a try and record itDetectron2Environment building process.
2. Python environment
First of all, we need to build a python environment. For the steps, please refer to the previous article using CONDA to install the deep learning framework pytoch.
Opencv3Is a well-known computer vision processing library. stayPython 3.6In the environment, use the following command and it is OK:
conda install -c menpo opencv3
But in thePython 3.7The above command is invalid in the environment. have access topypiInstallation:
pip install opencv-python
If your network is not good and easy to fail, we can temporarily use TsinghuapypiImage to install:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
fvcoreyesFAIROpen source is a lightweight core library that provides a variety of computer vision frameworks (such asDetectron2）The most common and basic features shared in. This library requires>=Python 3.6OfPythonEnvironmental Science.
CondaThe installation command is:
conda install -c fvcore fvcore
pypiThe installation command is:
pip install fvcore
reference resourcesChapter 3Use inpypiIt’s faster to mirror.
Microsoft releasedCOCOThe database is a large image data set designed for object detection, segmentation, human key point detection, semantic segmentation and caption generation. The coco API providesMatlab, PythonandLuaOfAPIInterface. TheAPIThe interface can provide complete loading, parsing and visualization of image tag data. adoptpycocotoolsLibrary we can useCOCOProvides a range of features. The installation method is different in different environments. Here is thelinuxFor example, environment:
pip3 install -U Cython pip3 install -U pycocotools
6. Other package dependencies
According to the project provided
GCCCompiler Version >= 4.9
7. Install detectron2
Here’s the point. The next big thing is installationdetectron 2Yes.
7.1 direct installation
You can directly execute the following command to install directly:
pip install 'git+https://github.com/facebookresearch/detectron2.git'
If the prompt does not have permission, please add it on the above command line
7.2 local installation
You can alsoGitPull to local installation:
git clone https://github.com/facebookresearch/detectron2.git cd detectron2 && pip install -e .
For MacOS users, whether the7.1perhaps7.2Should beOn its basisExecute the following installation command:
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ pip install -e .
And if more than one is installed on the machinecudaVersion may causenvccAndcudaVersion is inconsistent, there are solutions online, I did not encounter, so just to remind you.
Generally speaking, there are not too many problems to install according to the above steps. If you have good suggestions, you can pass the WeChat official account.FelordcnGive feedback. In the next article, we will discuss some practical problems.
Pay attention to the official account: Felordcn for more information
Personal blog: https://felord.cn