GithubHelp home page GithubHelp logo

mmac_t1's Introduction

MICCAI_TASK1

Step 1 : Configure the mmpretrain environment

git clone https://github.com/qingtian5/mmac_t1.git
cd MICCAI_TASK1
conda create -n miccai_mmpre python=3.8 pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch -y
conda activate miccai_mmpre
pip3 install openmim
git clone https://github.com/open-mmlab/mmpretrain.git
cd mmpretrain
mim install -e .
cd ..

Step 2 : Place the images in the data directory

  1. The dataset can be download by the Google Drive. And the directory under data should be as follows.
data
├── classification_train_val # This means the training set and the validation set are put together 
├── classification_train
└── classification_val
  1. For each folder, the ground truth label file (meta/train.txt) needs to be generated in the following way. If it is a validation set, change the path to meta/val.txt.
import pandas as pd

data = pd.read_csv("MICCAI_TASK1/data/classification_train/Groundtruths/train_labels.csv")

with open("MICCAI_TASK1/data/classification_train/meta/train.txt","w") as f:
    for idx, d in data.iterrows():
        f.write(d["image"] + " " + str(d["myopic_maculopathy_grade"]) + "\n")
  1. The following format is required for each folder under data. If is the validation dataset, the label file should be meta/val.txt.
classification_train
├── Groundtruths
│   └── train_labels.csv
├── Images
│   └── train
│       ├── mmac_task_1_train_0001.png
│       ├── mmac_task_1_train_0002.png
│       ├── ...
│       └── mmac_task_1_train_1143.png
├── LICENSE.txt
└── meta
    └── train.txt
classification_val
├── Groundtruths
│   └── val_labels.csv
├── Images
│   └── val
│       ├── mmac_task_1_val_0001.png
│       ├── mmac_task_1_val_0002.png
│       ├── ...
│       └── mmac_task_1_val_0248.png
├── LICENSE.txt
└── meta
    └── val.txt

Step 3 : Place pre-trained weights in the pretrained_ckpt catalog.

Run the following command on the terminal

cd pretrained_ckpt
wget https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin_base_patch4_window7_224_22kto1k-f967f799.pth
cd ..

Step 4 : Run the training script

Run the following command on the terminal

cd mmpretrain
python tools/train.py ../projects/submission/my_swin_base_in1k_384.py

Step 5 : submit the results

Run the following command on the terminal

cd ../projects/submission
mv ../working/epoch_36.pth ./epoch_36.pth
zip -r submission.zip .

Then submit the submission.zip file to the competition website Link.

TODO: Adding a weak label is complicated, and I'm going to release it quickly.

mmac_t1's People

Contributors

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