Code Monkey home page Code Monkey logo

mask_rcnn's Introduction

Mask_RCNN

基于Tensorflow实现Mask RCNN,主要参考matterport/Mask_RCNN

文件说明

  1. contourprocess

    建筑物掩膜的处理

  2. largest interior rectangle

    最大内接矩形算法(largest_interior_rectangle):https://github.com/lukasalexanderweber/lir

    imageimageimage

  3. 道格拉斯普克算法

运行DouglasPeuker.py即可

  1. 关于config文件

config文件包含两个,一个是在utils文件夹下的config.py,这一配置文件是训练以及推理过程中的基础设置的配置文件,里面包括基础的配置。另一个是根目录下的config文件,继承utils文件夹下的config.py,主要配置训练集,测试图像等路径。

训练

训练的时候注意一点:GPU数量暂时只能设定为1,如果需要多块GPU进行并行训练,可查看matterport/Mask_RCNN中有并行训练模型的代码。

训练数据的结构遵循VOC格式,包含三个文件夹:imgsmask以及yaml文件夹,分别存放原图、掩膜图像以及yaml文件,如何制作数据集请参考:Semantic-Segmentation-Datasets

image

制作好数据集后,修改config.py文件,运行train.py文件即可进行训练。

推理

修改config文件后运行inference.py文件即可。

ONNX推理可以参考:Deployment:MaskRCNN

模型评估

  1. Calculating mean Average Recall (mAR), mean Average Precision (mAP) and F1-Score

  2. compue_ap

  3. 语义分割之评价指标

模型转换

使用convert.py可以进行模型转换。如将权重和计算图转换成Tensorflow saved_model的格式。也可以将tensorflow的模型转换成ONNX的格式。详情请参考文档。 一些简单的使用例子如下:python .\convert.py --flag --saved_model .\save_model\ --save_onnx ./test.onnx或者python .\convert.py --weight .\model\village_building.h5 --label .\data\building.names --save_onnx ./test.onnx --saved_pb

参数说明:

  • weight:待转换的权重文件
  • label:标签文件的路径
  • saved_pb:是否保存pb文件
  • saved_pb_dir:保存pb文件的路径
  • saved_model:保存tensorflow模型
  • save_onnx:保存onnx文件路径
  • opset:onnx算子类型
  • flag:带有这个标记说明是tensorflow model模型转换成onnx,否则为权重转换成onnx模型

调试问题

  1. Input image dtype is bool. Interpolation is not defined with bool data type

image

参考:Input image dtype is bool. Interpolation is not defined with bool data type:pip install -U scikit-image==0.16.2

参考

  1. Mask RCNN源码解读
  2. Mask RCNN综述以及建筑物实例分割

mask_rcnn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mask_rcnn's Issues

多显卡训练的问题

您好,我现在正在用4张rtxa6000(48g)每张跑8个1024*1024的图像,但在all 阶段训练时就会出现显存溢出的问题
但是我将gpu_count改为1时,能够顺利完成训练,我不知道那里出了问题,我感到很困惑,希望您能够指导,万分感谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.