GithubHelp home page GithubHelp logo

almph / gaitpart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oliverhxh/gaitpart

0.0 0.0 0.0 50 KB

An Implementation of GaitPart: Temporal Part-based Model for Gait Recognition

Python 100.00%

gaitpart's Introduction

GaitPart

GaitPart is a CVPR 2020 paper.

NOTE

This repo is not official, but almost reproduces the same recognition accuracy on CASIA-B dataset like the paper said. This repo is based on GaitSet

Prerequisites

  • Python 3.6
  • PyTorch 1.5
  • CUDA 10.2

Getting started

Installation

pip install -r requirement.txt

Dataset & Preparation

Download CASIA-B Dataset

!!! ATTENTION !!! ATTENTION !!! ATTENTION !!!

Before training or test, please make sure you have prepared the dataset by this two steps:

  • Step1: Organize the directory as: your_dataset_path/subject_ids/walking_conditions/views. E.g. CASIA-B/001/nm-01/000/.
  • Step2: Cut and align the raw silhouettes with pretreatment.py. (See pretreatment for details.) Welcome to try different ways of pretreatment but note that the silhouettes after pretreatment MUST have a size of 64x64.

Futhermore, you also can test our code on OU-MVLP Dataset. The number of channels and the training batchsize is slightly different for this dataset. For more detail, please refer to our paper.

Pretreatment

Pretreatment your dataset by

python pretreatment.py --input_path='root_path_of_raw_dataset' --output_path='root_path_for_output'
  • --input_path (NECESSARY) Root path of raw dataset.
  • --output_path (NECESSARY) Root path for output.
  • --log_file Log file path. #Default: './pretreatment.log'
  • --log If set as True, all logs will be saved. Otherwise, only warnings and errors will be saved. #Default: False
  • --worker_num How many subprocesses to use for data pretreatment. Default: 1

Configuration

In config.py, you might want to change the following settings:

  • dataset_path (NECESSARY) root path of the dataset (for the above example, it is "gaitdata")
  • WORK_PATH path to save/load checkpoints
  • CUDA_VISIBLE_DEVICES indices of GPUs

Train

Train a model by

python train.py
  • --cache if set as TRUE all the training data will be loaded at once before the training start. This will accelerate the training. Note that if this arg is set as FALSE, samples will NOT be kept in the memory even they have been used in the former iterations. #Default: TRUE

Evaluation

Evaluate the trained model by

python test.py
  • --iter iteration of the checkpoint to load. #Default: 80000
  • --batch_size batch size of the parallel test. #Default: 1
  • --cache if set as TRUE all the test data will be loaded at once before the transforming start. This might accelerate the testing. #Default: FALSE

It will output Rank@1 of all three walking conditions. Note that the test is parallelizable. To conduct a faster evaluation, you could use --batch_size to change the batch size for test.

Result on CASIA-B dataset

I do experiments on CASIA-B dataset, 74 for training and 50 for testing, totally train 80000 iters, the accuracies are in the following

NM BG CL
GaitPart 96.2% 91.5% 78.7%
Ours 96.0% 90.6% 77.8%

gaitpart's People

Contributors

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