Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 1.8 KB

Image-classification.md

File metadata and controls

68 lines (48 loc) · 1.8 KB

Image Classification

Introduction

Welcome to the Image-Classification part, we have implemented the image-classification train pipeline based on mmdetection.

Main Support

Following models are implemented using PyTorch.

To do list:

  • VGG
  • GoogleNet
  • MobileNet
  • EfficientNet
  • Xception

Get Started

Please see GETTING_STARTED.md for the basic usage of MMDetection.

Prepare datasets

For image-classificatin, you need to prepare your datasets in the following formate. If your folder structure is different, you may need to change the corresponding paths in config files.

hymenoptera_data/
├── train
│   ├── ants
│   └── bees
├── val
│   ├── ants
│   └── bees

Train a model

Train with a single GPU

python tools/train.py ${CONFIG_FILE}

If you want to specify the working directory in the command, you can add an argument --work_dir ${YOUR_WORK_DIR}.

Train with multiple GPUs

./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]

Test

You can use the following commands to test a dataset.

# single-gpu testing
python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}] [--show]

# multi-gpu testing
./tools/dist_test.sh ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}]