Giter VIP home page Giter VIP logo

mykeras-yolo3's Introduction

My keras-yolo3

license

Introduction

My own Keras implementation of YOLOv3 (Tensorflow backend) inspired by qqwweee/keras-yolo3.


TO-DO

List of tasks:

  • [ ]: All-tools-included Packed tools from dataset creation to final predicts
  • [ ]: Baseline. Evaluation framework
  • [ ]: Avoid convert. Implement YOLO v3 in Keras directly. Hard

Set-up

  1. Download YOLOv3 weights from YOLO website. wget https://pjreddie.com/media/files/yolov3.weights
  2. Convert the Darknet YOLO model to a Keras model. python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5
  3. Run YOLO detection.
python predict.py [OPTIONS...] --image, for image detection mode,
python predict.py [video_path] [output_path (optional)] for video detection mode OR
python predict.py [--webcam] for webcam detection

Usage

Use --help to see usage of yolo_video.py:

usage: predict.py [-h] [--model MODEL] [--anchors ANCHORS]
                     [--classes CLASSES] [--gpu_num GPU_NUM]
                     [--image] [--webcam]
                     [--input] [--output]

positional arguments:
  --input        Input path
  --output       Output path

optional arguments:
  -h, --help         show this help message and exit
  --model MODEL      path to model weight file, default model_data/yolo.h5
  --anchors ANCHORS  path to anchor definitions, default
                     model_data/yolo_anchors.txt
  --classes CLASSES  path to class definitions, default
                     model_data/coco_classes.txt
  --gpu_num GPU_NUM  Number of GPU to use, default 1
  --image            Image detection mode
  --webcam           Webcam detection mode

Training

  1. Generate your own annotation file and class names file.
    One row for one image;
    Row format: image_file_path box1 box2 ... boxN;
    Box format: x_min,y_min,x_max,y_max,class_id (no space).
    For VOC dataset, try python voc_annotation.py
    An example:

    path/to/img1.jpg 50,100,150,200,0 30,50,200,120,3
    path/to/img2.jpg 120,300,250,600,2
    ...
    
  2. Modify kmeans.py path and number of clusters. Then run it and copy the new yolo_anchors.txt file to the model_data folder.

  3. Modify train.py paths and strategy and start training.
    python train.py
    Use your trained weights or checkpoint weights with command line option --model model_file when using predict.py Remember to modify class path or anchor path, with --classes class_file and --anchors anchor_file.

If you want to use original pretrained weights for YOLOv3:
1. wget https://pjreddie.com/media/files/yolov3.weights
2. python convert.py yolov3.cfg yolov3.weights model_data/yolo_weights.h5
4. use model_data/yolo_weights.h5 in train.py

Research

List of resources that could be useful:

Data sets

Supervised Logo images

Background images

Useful tools

mykeras-yolo3's People

Contributors

xpi2 avatar

Stargazers

ShengnanMa avatar

Watchers

paper2code - bot avatar

mykeras-yolo3's Issues

How long does clustering take?

Hi, can I check how long kmeans.py is supposed to run for?

I get a "RuntimeWarning: invalid value encountered in true_divide" but I think it is just a warning. It's been hours but no anchors.txt is generated.

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.