Mask R-CNN运行demo记录

参考文章:Mask RCNN 实战(一)--代码详细解析

首先下载项目源码:Mask R-CNN源码


在Ubuntu环境中实验


一、配置环境:

Mask R-CNN是基于Python3,Keras,TensorFlow。

Python 3.4+
TensorFlow 1.3+
Keras 2.0.8+
Jupyter Notebook
Numpy, skimage, scipy, Pillow, cython, h5py

(我使用的是Ubuntu系统,安装Anaconda3。)

一个坑:一开始使用的keras版本是2.2.0,结果发现太高了,发生了错误:

AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_by_name'

,换成了2.1.6版本,pip install keras==2.1.6 )

二、安装

  1. 安装依赖关系

    pip3 install -r requirements.txt
  2. 运行安装程序

    python3 setup.py install
  3. 下载训练好的权重:mask_rcnn_coco.h5,地址:releases
  4. 安装pycocotools:make生成对应的文件,make之后将生成的pycocotools文件夹复制到samples中的coco文件夹。 

(1)Linux地址:https://github.com/waleedka/coco (For Python, run "make" under coco/PythonAPI,

即进入文件夹PythonAPI,$make即可)

(2)windows地址:https://github.com/philferriere/cocoapi

You must have the Visual C++ 2015 build tools on your path (see the repo for additional details)

三、打开jupyter notebook运行demo.ipynb


在windows系统下配置环境类似


不同的是安装pycocotools时,提前下载Visual C++ 2015 build tools,地址:点击下载

安装完成之后在使用命令

pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

可以看到屏幕上显示:

Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
  Cloning https://github.com/philferriere/cocoapi.git to c:\users\phil\appdata\local\temp\pip-req-build-jn698z8p
Building wheels for collected packages: pycocotools
  Running setup.py bdist_wheel for pycocotools ... done
  Stored in directory: C:\Users\Phil\AppData\Local\Temp\pip-ephem-wheel-cache-rde3oevt\wheels\69\2b\12\2fa959e49f73d26cff202c2f4e5079096c9c57c8a8509fd75c
Successfully built pycocotools
Installing collected packages: pycocotools
Successfully installed pycocotools-2.0

 安装成功后运行demo.ipynb

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值