As the title, this repo is for Faster R-CNN implementation. The algorithm is mainly based on this article and this article
- Install Anaconda if you have not already.
- Create conda environment from file:
conda env create -f environment.yml
- Activate the conda environment:
conda activate rcnn
- Go to Google's open image dataset and download the classname description file and the box annotation files of the subset and put them in the dataset folder.
- Config the right path in
/dataset/data_selector.py
to generate 2 files and create 1 folder:
- a file containing image id to be downloaded (
data.txt
in this case). - a file which is the small version of the annotation file (
train-annotations-bbox.csv
in this case). - a folder containing the images to be downloaded (
open_image
in this case).
- Run the
/dataset/downloader.py
to download image into a folder.
# Change directory to dataset folder.
cd dataset
# For the case we want to use 2 processor.
python downloader.py data.txt --download_folder=open_image --num_processes=2
- Other dataset (fire detection):
- Start using the
notebook.py
file.
notebook.py
:environment.yml
:dataset
module:frcnn
module:
Week 1: Feb 1 - Feb 5: Chest X-ray project week 1
Week 2: Feb 8 - Feb 12: Chest X-ray project week 2
Week 3: Feb 15 - Feb 19: Chest X-ray project week 3
Week 4: Feb 22 - Feb 26: Chest X-ray project week 4
Week 5: March 1 - March 5: Chest X-ray project week 5
Week 6: March 8 - March 12: Chest X-ray project week 6
Week 7: March 15 - March 19: Chest X-ray project week 7
Week 8: March 22 - March 26: Chest X-ray project week 8
Week 9: March 29 - April 2: Shopee project week 9
Week 10: April 5 - April 9: Shopee project week 10
Week 11: April 12 - April 15: Shopee project week 11
Week 12: April 18 - April 22: Shopee project week 12
- [2 hours] Create the whole project pipeline and template, write documentation in readme.
- [0.5 hours] Prepare environment
rcnn
for the project. - [4 hours] Experiment with Google's open image dataset and setup the dataset downloader pipeline (and download).
- [0.5 hours] Read about the process of downloading the data from google api.
- [3.5 hours] Write code and fix bug to generate appropriate files and csv, as well as labels and annotation files.
- [1.5 hours] Read the paper Faster R-CNN in-depth. Refering to 5 sources of in-depth information about the method.
- [5.5 hours] Implement the overall structure of Faster R-CNN:
- [0.5 hours] Build and test transfer learning model with base VGG16 (
frcnn/models.py
). - [2 hours] Implement
iou
loss,rpn
classifier and regressor loss, and object classifier loss (frcnn/losses.py
). - [3 hours] Implement the
cal_rpn()
to generate the label for the rpn networks in the data generator.
- [0.5 hours] Build and test transfer learning model with base VGG16 (
- [3 hours]
get_data
function fixing bugs and revised innotebook.py
- [7 hours] Training pipeline fixing bugs and revised. Trainable now! (From line 288 to end in
notebook.py
)
- Done: trianing and evaluating
- BUG: Evaluating buggy
- Javior. 2018. Faster R-CNN: Down the rabbit hole of modern object detection. Trynolabs. https://tryolabs.com/blog/2018/01/18/faster-r-cnn-down-the-rabbit-hole-of-modern-object-detection/.
- Xy, Y. 2018. Faster R-CNN (object detection) implemented by Keras for custom data from Google’s Open Images Dataset V4. Toward Data Science. https://towardsdatascience.com/faster-r-cnn-object-detection-implemented-by-keras-for-custom-data-from-googles-open-images-125f62b9141a.
- Weng, L. 2017. Object Detection for Dummies Part 3: R-CNN Family. Lil' Log. https://lilianweng.github.io/lil-log/2017/12/31/object-recognition-for-dummies-part-3.html.
- Gad, A. F. 2020. Faster R-CNN Explained for Object Detection Tasks. Paperspace Blog. https://blog.paperspace.com/faster-r-cnn-explained-object-detection/.
- Geeksforgeek. 2020. Faster R-CNN | ML. Geeksforgeek. https://www.geeksforgeeks.org/faster-r-cnn-ml/
- RockyXu66. 2018. Faster R-CNN for Open Images Dataset by Keras. frcnn_train_vgg.ipynb. Github. https://github.com/RockyXu66/Faster_RCNN_for_Open_Images_Dataset_Keras/blob/master/frcnn_train_vgg.ipynb
- Phan, H. 2020. [Deep Learning] - Thuật toán Faster-RCNN với bài toán phát hiện đường lưỡi bò - Faster-RCNN object detection algorithm for Nine-dash-line detection!. Viblo. https://viblo.asia/p/deep-learning-thuat-toan-faster-rcnn-voi-bai-toan-phat-hien-duong-luoi-bo-faster-rcnn-object-detection-algorithm-for-nine-dash-line-detection-bJzKmREOZ9N
- Sharma, P. 2018. A Practical Implementation of the Faster R-CNN Algorithm for Object Detection (Part 2 – with Python codes). Analytics Vidhya. https://www.analyticsvidhya.com/blog/2018/11/implementation-faster-r-cnn-python-object-detection/