GithubHelp home page GithubHelp logo

yakhyo / yolov1-pytorch Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 5.0 317 KB

๐Ÿ” | YOLOv1 (Real-Time Object Detection) implementation using PyTorch

License: MIT License

Python 100.00%
yolov1-pytorch pytorch dataset yolo darknet voc object-detection

yolov1-pytorch's Introduction

YOLO v1 using PyTorch

Dataset:

  1. Download voc2012train dataset
  2. Download voc2007train dataset
  3. Download voc2007test dataset
  4. Put all images in JPEGImages folder in voc2012train and voc2007train to Images folder as following:
โ”œโ”€โ”€ Dataset 
    โ”œโ”€โ”€ IMAGES
        โ”œโ”€โ”€ 0001.jpg
        โ”œโ”€โ”€ 0002.jpg
    โ”œโ”€โ”€ LABELS
        โ”œโ”€โ”€ 0001.txt
        โ”œโ”€โ”€ 0002.txt
    โ”œโ”€โ”€ train.txt
    โ”œโ”€โ”€ test.txt

Each label consists of class and bounding box information. e.g 0001.txt :

1 255 247 425 468
0 470 105 680 468
1 152 356 658 754

How to convert .xml files to .txt format?

  • Download this repo and modify config.py to convert VOC format to YOLO format labels

Implementation of YOLOv1 using PyTorch

Train:

Note: I trained the backbone on IMAGENET, around ~ 10 epochs, not sure how many it was but less then 20

python main.py --base_dir ../../Datasets/VOC/ --log_dir ./weights 
usage: main.py [-h] --base_dir BASE_DIR --log_dir LOG_DIR [--init_lr INIT_LR] [--base_lr BASE_LR] [--momentum MOMENTUM] [--weight_decay WEIGHT_DECAY] [--num_epochs NUM_EPOCHS]
               [--batch_size BATCH_SIZE] [--seed SEED]

Evaluation:

  • python eval.py

  • In evaluation.py, im_show=False change to True to see the results.

Evaluate the detection result...
aeroplane                 0.57
bicycle                   0.46
bird                      0.38
boat                      0.25
bottle                    0.14
bus                       0.53
car                       0.48
cat                       0.61
chair                     0.18
cow                       0.34
diningtable               0.44
dog                       0.52
horse                     0.52
motorbike                 0.49
person                    0.49
pottedplant               0.21
sheep                     0.43
sofa                      0.38
train                     0.69
tvmonitor                 0.40
mAP 0.426056536787907

Detection

  • To detect objects on an image run the detect.py

yolov1-pytorch's People

Contributors

yakhyo avatar

Stargazers

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

Watchers

 avatar  avatar

yolov1-pytorch's Issues

Share the Weights

Hi,
Will it be possible to share the weights of this model over dropbox?

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.