Article Directory
1. Anaconda installation
Installation tutorial: Anaconda introduction, installation and usage tutorial
Tsinghua Open Source Mirror Network: Tsinghua Open Source Mirror Network
Some instructions:
- View all environments
conda env list
- Copy an environment, copy the test environment
conda create --name copy --clone test
- Delete an environment
conda remove --name test --all
2. Detectron2 environment configuration
Link: detectron2
1. requirements
- New environment
conda create --name detectron2 python=3.6
- Activate the environment
conda activate detectron2
- Install Pytorch, find Pytorch official website here
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch
- Install the opencv package
conda install --channel https://conda.anaconda.org/menpo opencv3
- Install the pycocotools package
pip install cython; pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
2. Object detection platform
3. Installation
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
3. Use of object detection platform Detectron2
1. Data set download
Link: COCO
2. Testing
- Find an image of the coco verification set and put
./detectron2/demo
it in the folder - Run command
- Activate the environment
conda activate detectron2
- Enter the path
cd ./detectron2/demo
- Run command
python demo.py --configfile ../configs/COCODetection/retinanet_R_50_FPN_1x.yaml --input 000000000785.jpg [--otheroptions]--opts MODEL.WEIGHTS detectron2://COCODetection/retinanet_R_50_FPN_1x/190397773/model_final_bfca0b.pkl
3. Test the accuracy of the trained model on the coco validation set
conda activate detectron2
cd ./detectron2
python ./tools/train_net.py --config-file ./configs/COCODetection/retinanet_R_50_FPN_1x.yaml --eval-only MODEL.WEIGHTS detectron2://COCODetection/retinanet_R_50_FPN_1x/190397773/model_final
_bfca0b.pkl
4. Solutions to common problems
-
pycharm is slow to load
Click Folder → Mark Directory as → excluded