Git Product home page Git Product logo

retinanet_tensorflow's Introduction

RetinaNet_TensorFlow

Implementation of RetinaNet by TensorFlow (object detection)

Introduction

Focal Loss

def focal_loss(logits, labels, alpha=0.25, gamma=2):
    pos_pt = tf.clip_by_value(tf.nn.sigmoid(logits), 1e-10, 0.999)
    fl = labels * tf.log(pos_pt) * tf.pow(1 - pos_pt, gamma) * alpha + (1 - labels) * tf.log(1 - pos_pt) * tf.pow(pos_pt, gamma) * (1 - alpha)
    fl = -tf.reduce_sum(fl, axis=2)
    return fl

How to use

Dataset

Pascal Voc: http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar

Training phase

  1. Downloading the pre-trained model of ResNet50, and put it into the folder resnet_ckpt

    Address: http://download.tensorflow.org/models/resnet_v2_50_2017_04_14.tar.gz

  2. According to your own dataset, modify the config.py by yourself

  3. Executing train.py

Testing phase

  1. Changing the IMG_PATH or VIDEO_PATH in test.py for testing

  2. Executing test.py

    Model we trained: https://drive.google.com/open?id=1_j-bjQ_SWT3txqCabM8_Ny0IMUqTb8Lk

Requirement

  1. python
  2. tensorflow
  3. pillow
  4. numpy
  5. cv2

Results

Total Loss Class Loss Box Loss

Reference

[1] Lin, Tsung-Yi, et al. "Focal loss for dense object detection." Proceedings of the IEEE international conference on computer vision. 2017.

Author

Mingtao Guo

retinanet_tensorflow's People

Contributors

mingtaoguo avatar

Stargazers

 avatar

Watchers

 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.