To install Detectron2 you need to have Pytorch and Torchvision installed along with Pycocotools.
To install Pycocotools On Windows, you must have the Visual C++ 2015 build tools on your path. If you don't, make sure to install them from here:
Then, run visualcppbuildtools_full.exe
and select default options:
After installing add them to your environment variables and run the command below:
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
This will install pycocotools into your opreating system.
After that install the requirements specified in the requirement file.
pip install -r requirement.txt
To build the Detectron2 you need fvcore
git clone https://github.com/facebookresearch/detectron2.git
cd detectron2 && pip install -e .
When all the requirements are installed clone the official repository of Detectron2 project from here or you can clone it by the process given below
git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
python setup.py build develop
After doing that all you need are pretrained models and pretrained weights.
You can get pre trained Mask RCNN model from here and pre trained weights from here Place these models and weights in the working directory of the python script.
At Last you need to download the Base RCNN model from here and you need to place this file out of the current working directory in the previous directory to use this base model.
After configuring this just run the python script given in the code put your image name or path in the script and run this.
You can get in touch with me on my LinkedIn Profile:
You can also follow my GitHub Profile to stay updated about my latest projects:
If you liked the repo then kindly support it by giving it a star ⭐!
If you find any bug in the code or have any improvements in mind then feel free to generate a pull request.
If you face any issue, you can create a new issue in the Issues Tab and I will be glad to help you out.
Copyright (c) 2019 SAAD HASSAN