• Stars
    star
    266
  • Rank 154,103 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for 15th place in Kaggle Google AI Open Images - Object Detection Track

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.3.1, Keras-RetinaNet 0.5.1

Pretrained models 2018

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 768 - 1024 533 MB 178 MB 0.4621 0.3520
ResNet101 768 - 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

Pretrained models 2019

There are 3 RetinaNet models based on ResNet50, ResNet101 and ResNet152 for all 500 classes.

Backbone Image Size (px) Model (training) Model (inference) Small validation mAP LB (Public)
ResNet50 768 - 1024 534 MB 178 MB 0.4594 0.4223
ResNet101 768 - 1024 752 MB 251 MB 0.4986 0.4520
ResNet152 600 - 800 932 MB 312 MB 0.4991 0.4651

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 Level 1 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

More Repositories

1

Weighted-Boxes-Fusion

Set of methods to ensemble boxes from different object detection models, including implementation of "Weighted boxes fusion (WBF)" method.
Python
1,719
star
2

Verilog-Generator-of-Neural-Net-Digit-Detector-for-FPGA

Verilog Generator of Neural Net Digit Detector for FPGA
Verilog
264
star
3

ZF_UNET_224_Pretrained_Model

Modification of convolutional neural net "UNET" for image segmentation in Keras framework
Python
213
star
4

volumentations

Library for 3D augmentations
Python
177
star
5

Keras-inference-time-optimizer

Optimize layers structure of Keras model to reduce computation time
Python
156
star
6

Mean-Average-Precision-for-Boxes

Function to calculate mAP for set of detected boxes and annotated boxes.
Python
121
star
7

MobileNet-in-FPGA

Generator of verilog description for FPGA MobileNet implementation
Verilog
120
star
8

MVSEP-MDX23-music-separation-model

Model for MDX23 music separation contest
Python
102
star
9

classification_models_3D

Set of models for classifcation of 3D volumes
Python
93
star
10

KAGGLE_DISTRACTED_DRIVER

Solutions
Python
93
star
11

segmentation_models_3D

Set of models for segmentation of 3D volumes
Python
89
star
12

Kaggle-Planet-Understanding-the-Amazon-from-Space

3rd place solution
Python
64
star
13

Keras-Mask-RCNN-for-Open-Images-2019-Instance-Segmentation

Code and pre-trained models for Instance Segmentation track in Open Images Dataset
Python
56
star
14

efficientnet_3D

EfficientNets in 3D variant for keras and TF.keras
Python
51
star
15

Keras-augmentation-layer

Keras implementation of layer which performs augmentations of images using GPU.
Python
49
star
16

VGG16-Pretrained-C

Pretrained VGG16 neural net in C language
C
45
star
17

2nd-place-solution-for-VinBigData-Chest-X-ray-Abnormalities-Detection

Localization of thoracic abnormalities model based on VinBigData (top 1%)
Python
36
star
18

KAGGLE_CERVICAL_CANCER_2017

Python
33
star
19

DrivenData-Alzheimer-Research-1st-place-solution

1st place solution for Clog Loss: Advance Alzheimer’s Research with Stall Catchers
Python
22
star
20

classification_models_1D

Classification models 1D Zoo - Keras and TF.Keras
Python
13
star
21

DrivenData-Identify-Fish-Challenge-2nd-Place-Solution

Solution for N+1 fish, N+2 fish DrivenData competition (2nd place)
Python
12
star
22

Covid-19-spread-prediction

Automatic short-term covid-19 spread prediction by countries and Russian regions
Python
10
star
23

MVSEP-CDX23-Cinematic-Sound-Demixing

Model for CDX23 (Cinematic Sound Demixing) contest
Python
9
star
24

DrivenData-Pri-matrix-Factorization-2nd-Place-Solution

DrivenData Pri-matrix Factorization (2nd place solution)
Python
8
star
25

DrivenData-Open-AI-Caribbean-Challenge-2nd-place-solution

Code for DrivenData Open AI Caribbean Challenge. 2nd place solution.
Python
7
star
26

VOTS2023-Challenge-Tracker

Code for VOTS2023 Challenge tracker
Python
7
star
27

KAGGLE_AVITO_2016

Avito Duplicate Ads Detection
Python
6
star
28

MobileNet-v1-Pytorch

MobileNet v1 in Pytorch. Weights converted from Keras implementation
Python
5
star
29

Post-Training-Integer-Quantization

Some examples of quantization process
Python
3
star
30

Audio-separation-models-checker

Python
3
star
31

demucs3

Fork of demucs repository
Python
3
star
32

KAGGLE_YELP

Solutions
Python
3
star
33

KAGGLE_DSB2

Solutions
Python
1
star
34

Pretrained-VGG-neural-nets-in-TensorFlow

Set of VGG neural net models for TensorFlow. Weights converted from Pytorch.
Python
1
star