Home

Awesome

On-Cloud-N: Cloud Detection Challange

<img src="assets/pipeline.png" alt="pipeline/concept" />

Info

Problem

Hardware requirements

Software requirements

Required software are listed on requirements.txt. Please install all the dependencies before executing the pipeline.

How to run

You can check the run.ipynb notebook for the main point of entry to my code.

Data preparation

First, the training and testing data should be downloaded from the competition website. Ideally, the data can be placed in the data folder in the repo directory. The repo tree would then look like below:

../on-cloud-n-19th-place-solution/
├── LICENSE.md
├── README.md
├── configs
│   ├── efficientnet-b1-unet-512.yaml
│   ├── resnext50_32x4d-unet-512.yaml
│   └── resnet34-unet-512.yaml
├── data
│   ├── train_features
│   │   ├── train_chip_id_1
│   │   │   ├── B02.tif
│   │   │   ├── B03.tif
│   │   │   ├── B04.tif
│   │   │   └── B08.tif
│   │   └── ...
│   ├── train_labels
│   │   ├── train_chip_id_1.tif
│   │   ├── ...
│   │   ...
│   ├── metadata_updated.csv
│   └── pseudo_labels.zip
...

Training

Run train.py to train final 3 models using appropriate arguments.

Training Pipeline

!python train.py --fast-dev-run 1 --cfg './configs/resnet34-unet-512.yaml'
!python train.py --fast-dev-run 1 --cfg './configs/efficientnet-b1-unet-512.yaml'
!python train.py --fast-dev-run 1 --cfg './configs/resnext50_32x4d-unet-512.yaml'

Prediction

<img src="assets/inference_pipeline.png" alt="inference_pipeline" width="450"/>

Run predict.py in order to predict on test images.

predict.py

Inference without Training:

First download the checkpoints mentioned in the info section above and place them on ./output directory then run the following codes.

!python predict.py --ensemble 1 --tta 1 --batch-size 8

Inference after Training:

After training is done, run the following codes.

!python predict.py --ensemble 1 --tta 1 --batch-size 8

Before predict, file tree would look like this:

../on-cloud-n-19th-place-solution/
...
├── data
│   ├── train_features
│   ├── train_labels
│   ├── test_features
│   └── train_metadata.csv
...
├── output
│    ├── resnet34-unet-512x512
│    │   ├── resnet34-unet-512.yaml
│    │   └── resnet34-unet.pt
│    ├── efficientnet-b1-unet-512x512
│    └── resnext50-unet-512x512
...