Giter Club home page Giter Club logo

fcos-lite's Introduction

FCOS-LITE

This is my first simple attempt to reproduce the famous anchor-free model:FCOS.

For origin FCOS, I think it is too big to deploy on my device. Specifically, FCOS makes a prediction on an 800 x 1024 image where the input image is much big. What's more, its backbone network, resnet-50, is a little big, and its detection head is also slow. Therefore, I want to build a light-weight FCOS: FCOS-LITE.

To overcome above disadvantages, I make the following adjustments:

  1. For backbone, I choose resnet-18. Although, I have trained darknet-19, which is also light and effective, resnet-18 is more convenient as PyTorch can easily import pre-trained model from model_zoo.

  2. For detection head, I substitute a YOLO-v3-style head for origin FCOS head. Because I can't get a good result with the share-weight head. The whole network structure is as shown:

Image

With those adjustments, I have gotten 69.5 mAP and 200 FPS(on RTX 2080-ti) on VOC2007 test with 320 input size. But that is not enough, and I'm considering how to get better result( faster on low-performance GPU, and almost real-time on CPU).

Before you clone this project, I must emphasize again that my FCOS-LITE is not yet mature and there are still many things to do for improvement.

Okay, I think you have known as much as possible. Just have fun !

Instillation

  • Pytorch >= 1.1.0
  • Torchvision >= 0.3.0
  • python-opencv, python3.6/3.7

Dataset

As for now, I only train and test on PASCAL VOC2007 and 2012.

VOC Dataset

I copy the download files from the following excellent project: https://github.com/amdegroot/ssd.pytorch

I have uploaded the VOC2007 and VOC2012 to BaiDuYunDisk, so for researchers in China, you can download them from BaiDuYunDisk:

Link:https://pan.baidu.com/s/1tYPGCYGyC0wjpC97H-zzMQ

Password:4la9

You will get a VOCdevkit.zip, then what you need to do is just to unzip it and put it into data/. After that, the whole path to VOC dataset is data/VOCdevkit/VOC2007 and data/VOCdevkit/VOC2012.

Download VOC2007 trainval & test

# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2007.sh # <directory>

Download VOC2012 trainval

# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2012.sh # <directory>

Train

To run:

python train_voc.py

You can run python train_voc.py -h to check all optional argument

Test

To run:

python test_voc.py --trained_model [ Please input the path to model dir. ]

Evaluation

To run:

python eval_voc.py --train_model [ Please input the path to model dir. ]

fcos-lite's People

Contributors

yjh0410 avatar

Watchers

James Cloos 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.