Extract CNN and Faster R-CNN Feature on Your Own
February 8, 2021 ยท View on GitHub
This document provides a walk-through of how we pre-compute ResNet50 features and Faster R-CNN objects features
CNN-pooling features
See video_dialogue_model/extract_features/run_resnet.py
Faster R-CNN objects features
-
Install
vqa-maskrcnn-benchmarkrepository and download the model and config.cd data wget https://dl.fbaipublicfiles.com/vilbert-multi-task/detectron_model.pth wget https://dl.fbaipublicfiles.com/vilbert-multi-task/detectron_config.yaml -
Extract features for images
See video_dialogue_model/extract_features/run_rcnn.py
For every
x.jpgimage, we will get ax.jpg.npyfile, which contains all infos generated by Faster R-CNN. -
Gather all
npyfile to buildobjects.mmapfilesSee video_dialogue_model/extract_features/build_rcnn_mmap.py