资源算法mask-rcnn-training

mask-rcnn-training

2020-02-13 | |  31 |   0 |   0

Mask R-CNN for table detection training on google colab GPU

Checklist!!

  • In custom.py updated class name to table(If not already edited).

  • Also replace images and annotation json in customeimages/ train and val folders!

  • Add the following into the code cell and execute.

!rm mask-rcnn-training/
!git clone https://github.com/Gerald2077/mask-rcnn-training
!pip install mrcnn
%cd mask-rcnn-training/

The above steps do the following to prepare jupyter notebook on colab-

  • Clear the previous repo folder !rm mask-rcnn-training/

  • Clone the repo, !git clone https://github.com/Gerald2077/mask-rcnn-training

  • Install mask rcnn using pip !pip install mrcnn

  • Navigate to the main directory %cd mask-rcnn-training/

Don't need this now,

import sys 
sys.path.insert(0, '/mask-rcnn-training')

Steps to view dataset using notebook

  • Open inspect_custom_data.ipynb in google colab by providing github repo link.

  • Select GPU from Edit -> Notebook Settings

  • Do copy to drive action.


Steps to train model

  • Run this in a separate code block after making sure GPU is enabled in EDIT->Notebook Settings & you have the initial steps like deleting folder, cloning repo & making sure a couple of images from the dataset are viewable with mask, before proceeding with training(taking 50 mins at the moment on GPU)

!python3 custom.py train --dataset=customImages/ --weights=coco
  • After training we will save the generated h5 file to our local machine & use it for inference using CPU. We can also verify the same with another notebook, where we need to upload the h5 file & update the filename in that notebook as well.

  • To download the h5 weights file, do the following-

Keep updating the same code block with below lines & repeat individually,
%cd ..
%cd logs/
%cd {into latest table, check the training log for h5 file name & folder it is enclosed in.}
#then run the below,
from google.colab import files
files.download('mask_rcnn_table_0010.h5')

Saving weight file on google drive and download

  • Mounting google drive

from google.colab import drive 
drive.mount('/content/gdrive')
  • Copy the file to google drive %cp mask_rcnn_table_0010.h5 /content/gdrive/'My Drive'/


上一篇:Cascade-Mask-R-CNN-in-Keras

下一篇: keras-mask-frcnn

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...