Giter Site home page Giter Site logo

sprinterzzj / kaggle-understanding-clouds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pudae/kaggle-understanding-clouds

0.0 1.0 0.0 72 KB

Code for 1st place solution in Understanding Clouds from Satellite Images Challenge.

License: BSD 2-Clause "Simplified" License

Python 97.52% Shell 2.48%

kaggle-understanding-clouds's Introduction

kaggle-understanding-clouds

Code for 1st place solution in Kaggle Understanding Clouds from Satellite Images Challenge.

To read the brief description of the solution, please, refer to the Kaggle post

Reproducing Submission

To reproduce my submission without retraining, do the following steps:

  1. Installation
  2. Download Dataset
  3. Download Pretrained models
  4. run bash reproduce.sh

Installation

All requirements should be detailed in requirements.txt. Using Anaconda is strongly recommended.

conda create -n cloud python=3.6
conda activate cloud
pip install -r requirements.txt

Prepare dataset

Download dataset

Download and extract train_images.zip and test_images.zip to data directory.

$ kaggle competitions download -c understanding_cloud_organization
$ unzip understanding_cloud_organization.zip -d data
$ chmod 644 data/*
$ unzip data/train_images.zip -d data/train_images
$ unzip data/test_images.zip -d data/test_images

Generate CSV files

$ python tools/split.py

Resize images and labels

$ python tools/resize_images.py
$ python tools/resize_labels.py

Training

In the configs directory, you can find configurations I used to train my final models.

Train models

To train models, run following commands.

$ python run.py train with {config_path} -f

Average weights

To average weights, run following commands.

$ python run.py swa with {config_path} swa.num_checkpoint=5 swa.ema=0.33 swa.epoch_end=40 -f

The result will be located in train_logs/{train_dir}/checkpoint.

Pretrained models

You can download pretrained model that used for my submission from link

$ mkdir checkpoints
$ bash download_pretrained.sh

Inference

If trained weights are prepared, you can create files that contains class/mask probabilities of images.

$ python run.py inference with {config_path} \
  inference.output_path={output_path}  \
  transform.params.tta={1..4} \
  inference.split={split} \
  checkpoint={checkpoint_path}

Evaluate

To evaluate dev/test_dev set, run following commands.

python tools/evaluate --input_dir {comma seperated list of inference_result_paths}

Make Submission

python tools/make_submission.py \
  --input_dir {comma seperated list of inference_result_paths} \
  --output {output_path}

kaggle-understanding-clouds's People

Contributors

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