- R-CNN stands for "Regions with CNN features", CNN stands for "Convolutional Neural Network"
- R-CNN grabs parts of an image (or region) as a bounding box, and computes each region for CNN features, it then classifies each region to determine what it is through ROI align, testing pixel by pixel to form the mask, R-CNN then takes the output from the ROI align and helps generate the bounding boxes and classifies the target to determine what it is
- mask R-CNN provides pixel level segmentation to mask over cars
In this case road obstacles ahead are being masked:
When installing or running python programs:
- Download Python 3.6:
- Install and download cuda:
- Install and download Download cuDNN v7.6.5 for CUDA 9.0 on Windows:
- Copy the following files from the "cudnn-9.0-windows10-x64-v7.6.5.32.zip" rar file into the CUDA Toolkit directory.
- Copy \cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin.
- Copy \cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include.
- Copy \cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64.
- Copy requirements.txt from the root directory in the "RequirementsFile" folder and place it in "D:\Python3\Scripts" and install it:
- Change directory to "Driver-Assist-Machine-Learning-With-RCNN-Mask-master" folder, and install the dependencies:
- Download the weight (mask_rcnn_coco.h5) from the releases page, and move it to the "Driver-Assist-Machine-Learning-RCNN-Mask-master\mrcnn" folder:
- Clone the cocoapi repo and extract into Driver-Assist-Machine-Learning-With-RCNN-Mask-master folder:
- cd into the extracted cocoapi folder and change to PythonAPI and install, path is "D:\Python3\Driver-Assist-Machine-Learning-With-RCNN-Mask-master\cocoapi-master\PythonAPI":
- Replace the video source file in the "VideoSourceFile" folder and change the code in line 113 with the name of your own footage to apply the masking to pre-captured footage.
https://developer.nvidia.com/cuda-10.1-download-archive-base?target_os=Windows&target_arch=x86_64
pip install tkintertable
pip install -r requirements.txt
py -3.6 setup.py install
py -3.6 setup.py build_ext install
Line 113: stream = cv2.VideoCapture("VideoSourceFile/Freewaytest.mp4")
If you are having issues running the demo.py, then delete the .egg file in "D:\Python3\lib\site-packages\mask_rcnn-2.1-py3.6.egg". It will be rebuilt when your run the applications.
Run the application:
*For pre-captured footage use the following below, this will create an output.mp4 with the masking and bounding box:
py -3.6 DAML_RCNN_Mask.py
*For real-time capture use the following below, bare in mind this is resource intensive:
py -3.6 DAML_RCNN_Mask_RealTime.py
If you have any other issues check the following link for other solutions:
General Install through pip:
pip install jupyterlab
If conda:
conda install -c conda-forge notebook
Guide for installing notebook: https://jupyter.org/install
cmd from "D:/python3/scripts", and run the following command to open jupyter notebook:
jupyter notebook
Copy the provided link, and paste in browser if it doesn't open on its own.
Mask R-CNN for Object Detection and Segmentation:
- Created by Matterport, Inc
- Source: https://github.com/matterport/Mask_RCNN
COCO API:
- Cloned by github user philferriere
- Source: https://github.com/philferriere/cocoapi