Codes for the paper "A Temporal Attentive Approach for Video-Based Pedestrian Attribute Recognition".
This repository contains PyTorch implementations of temporal modeling methods for video-based pedestrian attributes recognition. It is forked from Video-Person-ReID. Based on that, I implement temporal modeling methods including temporal pooling, temporal attention, RNN and 3D conv for multi-attributes recognition. PyTorch 0.4.1, Torchvision 0.2.1 and Python 3.7 is used.
Although previous work proposed many temporal modeling methods and did extensive experiments, but it's still hard for us to have an "apple-to-apple" comparison across these methods. As the image-level feature extractor and loss function are not the same, which have large impact on the final performance. Thus, we want to test the representative methods under an uniform framework.
Please follow deep-person-reid to prepare the data. The instructions are copied here:
mars/
under data/
.data/mars/
from http://www.liangzheng.com.cn/Project/project_mars.html.bbox_train.zip
and bbox_test.zip
.info/
in data/mars
(we want to follow the standard split in [8]). mars_attributes.csv
from http://irip.buaa.edu.cn/mars_duke_attributes/index.html, and put the file in data/mars
. The data structure would look like:
mars/
bbox_test/
bbox_train/
info/
mars_attributes.csv
-d mars
when running the training code.duke/
under data/
.data/duke/
from http://vision.cs.duke.edu/DukeMTMC/data/misc/DukeMTMC-VideoReID.zip.DukeMTMC-VideoReID.zip
.duke_attributes.csv
from http://irip.buaa.edu.cn/mars_duke_attributes/index.html, and put the file in data/duke
. The data structure would look like:
duke/
train/
gallery/
query/
duke_attributes.csv
-d duke
when running the training code.To train the model, please run
python -u main_video_attr_recog.py --arch=attr_resnet50tp --model_type="ta"
arch could be Temporal Attention Method (--arch=attr_resnet50tp --model_type="ta"), Temporal Pooling Method (--arch=attr_resnet50tp --model_type="tp"), RNN Attention Method (--arch=attr_resnet50tp --model_type="rnn"), 3D conv (--arch=attr_resnet503d). For 3D conv, I use the design and implementation from 3D-ResNets-PyTorch, just minor modification is done to fit the network into this person attributes recognition system.
Other detailed settings for different temporal modeling could be found in models/AttrModels.py