This requires an older tensorflow version so we have to use pyenv
- Install
pyenv
https://github.com/pyenv/pyenv pyenv install 3.7
pyenv global 3.7
- Run
python -m venv .env
- Run
source .env/bin/activate
- Run
pip install -r requirements.txt
- Run
wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5
- In another directory run
git clone https://github.com/matterport/Mask_RCNN.git
and copy themrcnn
folder to the root folder of this project
maturin develop
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python3 model.py
maturin build --release
pip install <path>/<to>/<wheel>.whl --force-reinstall
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python3 -O model.py
You may be prompted to install a library related to graphics, like xcb
in order to display the image. Follow the instructions.
Ref: https://blog.paperspace.com/mask-r-cnn-in-tensorflow-2-0/