Giter Club home page Giter Club logo

awesome_ssd_fpn_giou's Introduction

SSD_FPN_GIoU, in PyTorch

This is a SSD experiment reposity, the purpose is to reproduce some related papers based on SSD The code references SSD: Single Shot MultiBox Object Detector, in PyTorch and mmdet. Currently, some experiments are carried out on the VOC dataset, if you want to train your own dataset, you can refer to the part of training-yourself-dataset.

Table of Contents

       

Fold-Structure

The fold structure as follow:

  • config/
    • config.py
    • init.py
  • data/
    • init.py
    • VOC.py
    • VOCdevkit/
  • model/
    • build_ssd.py
    • init.py
    • backbone/
    • neck/
    • head/
    • utils/
  • utils/
    • box/
    • detection/
    • loss/
    • init.py
  • tools/
    • train.py
    • eval.py
    • test.py
  • work_dir/

Environment

  • pytorch 0.4.1
  • python3+
  • visdom
    • for real-time loss visualization during training!
     pip install visdom
    • Start the server (probably in a screen or tmux)
     python visdom
    • Then (during training) navigate to http://localhost:8097/ (see the Train section below for training details).

Datasets

  • PASCAL VOC:Download VOC2007, VOC2012 dataset, then put VOCdevkit in the data directory

Training

Training VOC

python tools/train.py
  • Note:
    • For training, default NVIDIA GPU.
    • You can set the parameters in the train.py (see 'tools/train.py` for options)
    • In the config,you can set the work_dir to save your training weight.(see 'configs/config.py`)
    • if you want to selected the classficaiton and Regression Loss, you can to change the train_config. Now, we provide the classficaiton {FocalLoss,CrossEntropy},Regression {SmoothL1,Giou}.(see 'configs/config.py`)

Training yourself dataset

  • if you want to trainning yourself dataset, there are some steps:
  1. you need to make the dataset refer the VOC dataset, and take it to data/
  2. in the data/ ,you need make yourself-data.py, for example CRACK.py(it is my dataset), and change it according to your dataset. Also,in the init.py you can write something about your dataset
  3. change the config/ config.py, and make your dataset config,like CRACK(dict{})
  4. In the main,load your dataset.
  • In the SSD_FPN_GIoU fold:
python tools/train.py

Evaluation

  • To evaluate a trained network:
python eval.py --trained_model your_weight_address

Test

  • To test a trained network:
python test.py -- trained_model your_weight_address

if you want to visual the box, you can add the command --visbox True(default False)

Performance

VOC2007 Test mAP

  • Backbone is the ResNet50:
Test mAP(iou=0.5) mAP(iou=0.6) mAP(iou=0.75)
SSD 75.49% 70.87% 53.44 %
SSD+Gious 76.09% 71.01% 54.70 %
SSD+FPN 78.99% 73.18% 55.19 %
SSD+FPN+Gious 78.96% 73.35% 55.83 %

result

FPS

  • SSD+FPN+Gious: GTX 1080ti: ~35 FPS

Download a pre-trained network

  • Currently, we provide the following PyTorch models:

Authors

References

awesome_ssd_fpn_giou's People

Contributors

jaryhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

awesome_ssd_fpn_giou's Issues

hello

我在训练的过程中出现:KeyError: 'resnet50'。想咨询您,这个怎么解决?

very slow when evaluating

it seems that nms in the Detection runs on GPU makes infere much slower, only 10FPS on Rtx2080TI, which is much slower than that in Readme.

In training yourself dataest,I have two questions for you

In training yourself dataest,2.in the data/ ,you need make yourself-data.py, for example CRACK.py(it is my dataset), and change it according to your dataset. Also,in the init.py you can write something about your dataset
3.change the config/ config.py, and make your dataset config,like CRACK(dict{})
in the 2 step,how to make yourself-data.py and change it according to your dataest?and in the init.py what i write about my dataest?
in the 3 step,how to change the config/config.py and how to make my dataest config?

使用GIOU损失出现了一个问题

在使用SmoothL1为定位损失时,模型训练正常,但改为GIOU时,出现了one of the variables needed for gradient computation has been modified by an inplace operation问题,请问如何解决(我尝试了改变代码中 inplace=True 或者 x += y 等操作,但问题还是存在,请问Giou模块中还有哪些是inplace操作)。诚挚的感谢

ModuleNotFoundError: No module named 'pretrainedmodels'

我下载了您github中的预训练模型,应该放在哪里呢?

输入python tools/train.py后报错

Traceback (most recent call last):
File "tools/train.py", line 4, in
from model import build_ssd
File "/root/yyf/awesome_SSD_FPN_GIoU-master/model/init.py", line 1, in
from .build_ssd import build_ssd
File "/root/yyf/awesome_SSD_FPN_GIoU-master/model/build_ssd.py", line 10, in
from model.backbone import Backbone
File "/root/yyf/awesome_SSD_FPN_GIoU-master/model/backbone/init.py", line 1, in
from .build_backbone import Backbone
File "/root/yyf/awesome_SSD_FPN_GIoU-master/model/backbone/build_backbone.py", line 1, in
import pretrainedmodels
ModuleNotFoundError: No module named 'pretrainedmodels'

proper loss but poor result?

with gious, the final loss is about 1.8, conf loss is about 1.4 and gious loss is about 0.4, but the mAP of final pth is only about 49 ?

How to not use FPN?

Default config is SSD+FPN+GIOU, right? Is there any way to train with SSD+GIOU?

IndexError: list index out of range

when i train voc , it has been come.
Traceback (most recent call last):
File "R:/SSD giou/awesome_SSD_FPN_GIoU-master/tools/train.py", line 278, in
train()
File "R:/SSD giou/awesome_SSD_FPN_GIoU-master/tools/train.py", line 89, in train
parser.error('Must specify dataset_root if specifying dataset')
File "R:\anaconda\envs\SSD\lib\argparse.py", line 2519, in error
self.print_usage(_sys.stderr)
File "R:\anaconda\envs\SSD\lib\argparse.py", line 2489, in print_usage
self._print_message(self.format_usage(), file)
File "R:\anaconda\envs\SSD\lib\argparse.py", line 2455, in format_usage
return formatter.format_help()
File "R:\anaconda\envs\SSD\lib\argparse.py", line 282, in format_help
help = self._root_section.format_help()
File "R:\anaconda\envs\SSD\lib\argparse.py", line 213, in format_help
item_help = join([func(*args) for func, args in self.items])
File "R:\anaconda\envs\SSD\lib\argparse.py", line 213, in
item_help = join([func(*args) for func, args in self.items])
File "R:\anaconda\envs\SSD\lib\argparse.py", line 320, in _format_usage
action_usage = format(optionals + positionals, groups)
File "R:\anaconda\envs\SSD\lib\argparse.py", line 395, in _format_actions_usage
start = actions.index(group._group_actions[0])
IndexError: list index out of range

the visdom cant run. and when i train the ssd,the erroe as follow:

/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /update (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fadec7485f8>: Failed to establish a new connection: [Errno 111] Connection refused',))

run time error in train

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

您好

您是对比了SSD、SSD+FPN、SSD+GIOU和SSD+GIOU+FPN,想问您有没有SSD+FPN以及SSD+GIOU的项目?我想对比一下这几种的方法?

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.