Giter Club home page Giter Club logo

keras-retinanet-for-open-images-challenge-2018's Introduction

Keras-RetinaNet for Open Images Challenge 2018

This code was used to get 15th place in Kaggle Google AI Open Images - Object Detection Track competition: https://www.kaggle.com/c/google-ai-open-images-object-detection-track/leaderboard

Repository contains the following:

  • Pre-trained models (with ResNet101 and ResNet152 backbones)
  • Example code to get predictions with these models for any set of images
  • Code to train your own classifier based on Keras-RetinaNet and OID dataset
  • Code to expand predictions for full 500 classes

Online demo

http://nn-box.com/box/ - upload image wait several seconds and it will show boxes. ResNet152 is used as backbone.

Requirements

Python 3.5, Keras 2.2, Keras-RetinaNet 0.4.1

Pretrained models

There are 3 RetinaNet models based on ResNet50, ResNet101 and ResNet152 for 443 classes (only Level 1).

Backbone Image Size (px) Model (training) Model (inference) Small validation mAP Full validation mAP
ResNet50 728 - 1024 533 MB 178 MB 0.4621 0.3520
ResNet101 728 - 1024 739 MB 247 MB 0.5031 0.3870
ResNet152 600 - 800 918 MB 308 MB 0.5194 0.3959
  • Model (training) - can be used to resume training or can be used as pretrain for your own classifier
  • Model (inference) - can be used to get prediction boxes for arbitrary images

Inference

Example can be found here: retinanet_inference_example.py

You need to change files_to_process = glob.glob(DATASET_PATH + 'validation_big/*.jpg') to your own set of files. On output you will get "predictions_*.csv" file with boxes.

Having these predictions you can expand it to all 500 classes using code from create_higher_level_predictions_from_level_1_predictions_csv.py

Training

For training you need to download OID dataset (~500 GB images): https://storage.googleapis.com/openimages/web/challenge.html

Next fix paths in a00_utils_and_constants.py

Then to train on OID dataset you need to run python files in following order:

  • create_files_for_training_by_levels.py
  • retinanet_training_level_1/find_image_parameters.py

then

  • retinanet_training_level_1/train_oid_level_1_resnet101.py

or

  • retinanet_training_level_1/train_oid_level_1_resnet152.py

Ensembles

If you have predictions from several models, for example for ResNet101 and ResNet152 backbones, then you can ensemble boxes with script:

Proposed method increases the overall performance:

  • ResNet101 mAP 0.3776 + ResNet152 mAP 0.3840 gives in result: mAP 0.4220

Method description

keras-retinanet-for-open-images-challenge-2018's People

Contributors

zfturbo 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.