Giter Club home page Giter Club logo

pelee.pytorch's Introduction

Pelee: A Real-Time Object Detection System on Mobile Devices, in PyTorch

A PyTorch implementation of Pelee: A Real-Time Object Detection System on Mobile Devices The official and original Caffe code can be found here.

Description

I train Pelee with pytorch and the result is better than the original paper result,the pretrained model can be downloaded in peleenet.pth.

MAP in VOC2007

Method 07+12 07+12+coco
SSD300 77.2 81.2
SSD+MobileNet 68 72.7
Original Pelee 70.9 76.4
Ours Pelee 71.76 ---

Preparation

the supported version is pytorch-0.4.1 or pytorch-1.0

  • tqdm
  • opencv
  • addict
  • pytorch>=0.4
  • Clone this repository.
git clone https://github.com/yxlijun/Pelee.Pytorch
  • Compile the nms and coco tools:
sh make.sh
  • Prepare dataset (e.g., VOC, COCO), refer to ssd.pytorch for detailed instructions.

train

you can train different set according to configs/*,First, you should download the pretrained model peleenet.pth,then,move the file to weights/

python train.py --dataset VOC\COCO --config ./configs/Pelee_VOC.py  

if you train with multi gpu

CUDA_VISIBLE_DEVICES=0,1 python train.py --dataset VOC\COCO --config ./configs/Pelee_VOC.py   --ngpu 2

eval

you can evaluate your model in voc and coco

python test.py --dataset VOC\COCO  --config ./configs/Pelee_VOC.py --trained_model ./weights/Pelee_VOC.pth 

demo

you can test your image, First, download the trained model Pelee_VOC.pth file. Then, move the file to weights/.

python demo.py --dataset VOC\COCO  --config ./configs/Pelee_VOC.py --trained_model ./weights/Pelee_VOC.pth --show  

You can see the image with drawed boxes as:

TODO

the code support:

  • Support for the MS COCO dataset and VOC PASCAL dataset
  • Support for Pelee304_VOC、Pelee304_COCO training and testing
  • Support for mulltigpu training
  • Support training and and testing in VOC and COCO

References

pelee.pytorch's People

Contributors

yxlijun 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

Watchers

 avatar  avatar  avatar

pelee.pytorch's Issues

Train on Higher Res

I would like to train the model on higher resolution such as 604, what changes would you recommend? At the moment you have put a check to train only on 304 input size.

License file

hey thanks for providing this , going to try it out.

can you provide a license file with the repo please ?

thanks,
Atti

denseblock写的有问题

原文denseblock里面不应该重复transition层吧,你的循环生成denseblock里面重复了transition,在用你的代码训练目标检测的时候效果不是很好,我改yolo做的就不是很成功。不知道你对这个模块是怎么理解的?重复transition能提高精度么?

Disabling GPU

When I disable GPU in configs/Pelee_VOC.py test_cfg.cuda = false. I got RuntimeError: expected device cpu but got device cuda:0.

So some model is using GPU. But I am not able to figure which one.

The performance of my trained model is very bad

Hi, first thank you your work, it is very good. I have a datasets about one thousand images, the resolution is 1920x1080. I have use your source to train the datasets about 12 hours, but the model can not find the object a little. It is a mess of bounding boxes everywhere in the image. I did not modify the train parameters except the class number and class name, can you give me some advice? thanks very much!!!

fresh man ask for help about the dataset

hi~~~
i am a new man in this. your repository is amazing for me, but i have a problem with the dataset.maybe its not a big problem for u.
i already download the Pelee_VOC.pth and put it to weights folder, and i follow the steps to download the dataset VOC2007, and it looks like this.
image
and i run the command
python demo.py --dataset VOC\VOC2007 --config ./configs/Pelee_VOC.py --trained_model ./weights/Pelee_VOC.pth --show
but it comes out the
image
i dont whats wrong? could u help me? thx~~~

problems about FPS

hello,i test the FPS on nvidia-p100, but it only get about 30FPS,it is too low, so i want to ask that whether it is normal?

wrong when construct _DenseLayer

class _DenseLayer(nn.Module):
"""docstring for _DenseLayer"""

def __init__(self, num_input_features, growth_rate, bottleneck_width, drop_rate):
    super(_DenseLayer, self).__init__()
    growth_rate = growth_rate // 2
    inter_channel = int(growth_rate * bottleneck_width / 4) * 4

    if inter_channel > num_input_features / 2:
        inter_channel = int(num_input_features / 8) * 4
        print('adjust inter_channel to ', inter_channel)

    self.branch1a = conv_bn_relu(
        num_input_features, inter_channel, kernel_size=1)
    self.branch1b = conv_bn_relu(
        inter_channel, growth_rate, kernel_size=3, padding=1)

    self.branch2a = conv_bn_relu(
        num_input_features, inter_channel, kernel_size=1)
    self.branch2b = conv_bn_relu(
        inter_channel, growth_rate, kernel_size=3, padding=1)
    self.branch2c = conv_bn_relu(
        growth_rate, growth_rate, kernel_size=3, padding=1)

def forward(self, x):
    out1 = self.branch1a(x)
    out1 = self.branch1b(out1)

    out2 = self.branch2a(x)
    out2 = self.branch2b(out2)
    out3 = self.branch2c(out2)

    out = torch.cat([x, out1, out2], dim=1)  // torch.cat([x, out1, out3], dim=1)
    return out

free(): invalid pointer Aborted (core dumped) when training

----------------------------------------------------------------------
|                       Pelee Training Program                       |
----------------------------------------------------------------------
free(): invalid pointer
Aborted (core dumped)

This happens when I try to train the Pelee on custom dataset (VOC format).
I think it has something to do with free(), but I'm not sure what to change.

ImportError: No module named addict

When I ran the train command, there was an error:
File "./Pelee.Pytorch/configs/CC.py", line 14, in
from addict import Dict
ImportError: No module named addict

I can't deal with this problem since I can't find the module addict. Could you please tell me what's going on? Thanks!

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.