zeenolife / openeds_2020

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1st Place Solution for Facebook's OpenEDS 2020 Sparse Semantic Segmentation Challenge

demo image

Requirements

  • Linux
  • Python 3.6+
  • PyTorch 1.3+
  • CUDA 9.2+

To install requirements:

pip install -r requirements.txt

Data Preparation

First, prepare folds for training

python dataset/create_kfolds.py

Training

To train the model, run this command:

python train.py --config <path_to_config> --data-dir <path_to_data> --gpu <gpu_ids> --fold <fold_id>

List of other parameters can be seen inside train.py

Inference

To inference a model, run:

python predict_ensemble.py --data-dir <path_to_data> --label-file <path_to_file_with_sample_names> --save-dir <path_to_save> --gpu <gpu_ids>

Models that should be inferenced are written in predict_ensemble.py.
path_to_file_with_names is a file with all sample names e.g. S_0/label_0.npy and etc.

Evaluation

To evaluate model, run:

python validate.py --data-dir <path_to_data> --pred-dir <path_to_predictios> --fold <fold_id>

Predictions from model should be inferenced beforehand

Pre-trained Models

You can download pretrained models here:

Results

Our models achieve the following performance on:

OpenEDS 2020 Sparse Semantic Segmentation Leaderboard

Model mIoU
UNet EfficientNet-b7 95.15%
Ensemble of 10 Models 95.17%

The reason why the ensemble gives such a small accuracy increase is that most of the models in the ensemble were trained sub-optimally, as we've found out best training pipeline towards the end of the competition.

Acknowledgement

We thank Selim Seferbekov and Pavel Yakubovskiy for wonderful codebase that we extensively used during competition.

About


Languages

Language:Python 100.0%