Giter VIP home page Giter VIP logo

mask-rcnn-torchvision's Introduction

Using Torchvision for Train Instance Segmentation

Env Configuration(win 10)

Setup Conda Env

conda create --name maskrcnn
conda activate maskrcnn
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

Install pytorch & cuda

conda install pytorch torchvision cudatoolkit=10.0

tips: if pycocotools can not successfully be installed, download *.whl from https://pypi.tuna.tsinghua.edu.cn/simple/pycocotools-windows/

pip install /path/to/pycocotools_windows_xxxx.whl

DIY Dateset Processing

convert your own dateset from labelme format to PennFudanPed format you can reference to this video: https://www.bilibili.com/video/BV1R7411F7QP

  1. Put your *.jpg files and json files together in one file after annotating, then run
python new_json_to_dataset.py path/to/original/dataset
  1. Extract png and gth
    put copy.py together with *.jpg and json, then run
python copy.py
  1. Copy your pngs and masks into PennFudanPed2/PNGImages ans PennFudanPed2/PedMasks manually

Getting started

  1. before training, edit the parameters on line 141, 184, 185 in train.py to your needs.
  • names = {'0': 'background', '1': 'train'}
  • num_classes = 2
  • train_num = 1200
  1. Start training
python train.py

Predict

before predicting, editing the same params as training.

python predict.py

Result

result1 result2 result3 result6

mask-rcnn-torchvision's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.