Code Monkey home page Code Monkey logo

fpn_toyotakyushu's Introduction

fpn-pytorch1.0

Introduction

This repo mainly based on jwyang/fpn.pytorch and jwyang/faster-rcnn.pytorch. I combine some code to let it ables to work in pytorch1.0 framework and get a more 75.8mAP(higher than faster rcnn & fpn0.4 repo) when training pascal voc 2007.

Iherent from them, this repo support multi GPU training, GPU version NMS and ROI Align pooling. Thanks a lot for jwyang. More usage introduction can be found in the upper two repo.

Demo Result

Benchmarking

I benchmark this code thoroughly on pascal voc2007 (voc0712 is on the way). Below are the results:

1). PASCAL VOC 2007 (Train/Test: 07trainval/07test, scale=600, ROI Align,

model GPUs Batch Size lr lr_decay max_epoch Speed/epoch Memory/GPU mAP
Res-101 1 RTX 2080 1 1e-3 5 12 \ \ 75.8

Preparation

clone the code

git clone https://github.com/tianyolanda/fpn_toyotakyushu.git

Then, create a folder:

cd fpn-pytorch1.0 
mkdir data
mkdir logs

prerequisites

The environment I run this code is under:

  • Python 3.7
  • Pytorch 1.0
  • CUDA 10.0

visdom are support for visilization of loss curve

Data Preparation

  • VOC2007 or VOC07+12: Please follow the instructions in py-faster-rcnn to prepare VOC datasets. Actually, you can refer to any others. After downloading the data, creat softlinks in the folder data/.

  • COCO dataset is not supported in this repo yet

Pretrained Model

Pretrained Model we need for FPN is ResNet101.

Download from here jwyang/faster-rcnn.pytorch

Download it and put it into the data/pretrained_model/.

Compilation

Install all the python dependencies using pip:

pip install -r requirements.txt

Compile the cuda dependencies using following simple commands:

cd lib
python setup.py build develop

It will compile all the modules you need, including NMS, ROI_Align. Please check to compiled with coorsponding python version.

Usage

train voc2007:

CUDA_VISIBLE_DEVICES=0 python trainval_net.py --dataset pascal_voc --cuda

test voc2007:

CUDA_VISIBLE_DEVICES=0 python test_net.py --dataset pascal_voc --checksession 1 --checkepoch 12 --checkpoint 10021 --cuda

train voc07+12:

CUDA_VISIBLE_DEVICES=0 python trainval_net.py --dataset pascal_voc_0712 --cuda

Use trained FPN model

Download

Here I provide my trained FPN model(trained on pascal voc 2007, can detect 20 kinds of objects), you can simply test it without training.

Download the model from baiduyun

usage

put the trained FPN model in /fpn-pytorch1.0/models/res101/pascal_voc/fpn_1_12_10021.pth

check demo image detection result

Put images to be detected in /fpn-pytorch1.0/images/

Then run demo.py

CUDA_VISIBLE_DEVICES=0 python demo.py --dataset pascal_voc --checkepoch 12 --cuda

TODO List

  • Train and test on VOC0712
  • Train and test on COCO
  • Support softNMS
  • Support DetNet

fpn_toyotakyushu's People

Contributors

tianyolanda avatar

Watchers

 avatar  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.