This repository contains jupypter notebook for qualitatively analyzing the quality of proposals obtained from a trained Region Proposal Network (RPN). Specifically support for topK and max-size proposals is provided.
- TopK: Plot topK RPN proposals on a given input image (order based on the objectness score of proposals)
- Max-Size: Take top32 proposals for a given image and plot the one which covers the maximum area within its bounding box
This repo is completely based on official detectron2 library. You will need to install the required packages by running the following commands.
# Install torch and torchvision
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
# Install Detectron2 (for more details visit : https://detectron2.readthedocs.io/en/latest/tutorials/install.html)
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
# Install matplotlib for visualizations
python -m pip install -U matplotlib
pip3 install Pillow
Simply run the cells of the notebook RPN_proposals.ipynb
, for getting started.
For plotting top5 proposals on a given image, you can run the cell
# TOP5
plot_RPN_proposals(image_file_name, 0, batched_inputs,proposals,5)
Sample Output:
For plotting the maxsize proposal on a given image, you can run the cell
# Maxbox
plot_RPN_proposals(image_file_name, 0, batched_inputs,proposals)
Sample Output: