/Sleeping-posture-classification

This project includes multiple models, loss functions, optimizers and image augmentations for image classification task

Primary LanguagePythonMIT LicenseMIT

IR-pose-classification

Requirements

Installation

  • Clone this repository:
git clone https://github.com/ngocphucck/IR-pose-classification
cd IR-pose-classification
  • Install dependencies: Please type the command pip install -r requirements.txt.

Implementations

  • Firstly, you have to prepare your annotations. I recommend that you organize your labelling file into 2 files: train.json and val.json with the form image_path: label.

  • After that, you can define some parameters in your method. There are 2 options for you to do that:

    • Change parameters in defaults.py.
    • Another way is to be more flexible. You'll create YAML configuration files; typically, you'll make one for each experiment. But, when actually implementing, you need to merge this .yaml file with defaults.py. The following code makes this action:
    cfg = get_cfg('path_to_file')
    cfg.merge_from_file("experiment.yaml")
    cfg.freeze()
  • Train a model:

cd tools
python train.py

Components

Backbones Loss functions Optimizers Augmentations
  • Cross Entropy
  • Adam
  • RandAug

Future works

  • Multiple backbones
  • Data augmentations
  • Multiple loss functions
  • Experiment managment
  • Edge devices deployment
  • UI demo/Docker resource
  • Distributed computing