Code repository for the paper "Tracking People with 3D Representations"

Related tags

Deep Learning T3DP
Overview

Tracking People with 3D Representations

Code repository for the paper "Tracking People with 3D Representations" (paper link) (project site).
Jathushan Rajasegaran, Georgios Pavlakos, Angjoo Kanazawa, Jitendra Malik.
Neural Information Processing Systems (NeurIPS), 2021.

This code repository provides a code implementation for our paper T3DP, with installation, preparing datasets, and evaluating on datasets, and a demo code to run on any youtube videos.

Abstract : We present a novel approach for tracking multiple people in video. Unlike past approaches which employ 2D representations, we focus on using 3D representations of people, located in three-dimensional space. To this end, we develop a method, Human Mesh and Appearance Recovery (HMAR) which in addition to extracting the 3D geometry of the person as a SMPL mesh, also extracts appearance as a texture map on the triangles of the mesh. This serves as a 3D representation for appearance that is robust to viewpoint and pose changes. Given a video clip, we first detect bounding boxes corresponding to people, and for each one, we extract 3D appearance, pose, and location information using HMAR. These embedding vectors are then sent to a transformer, which performs spatio-temporal aggregation of the representations over the duration of the sequence. The similarity of the resulting representations is used to solve for associations that assigns each person to a tracklet. We evaluate our approach on the Posetrack, MuPoTs and AVA datasets. We find that 3D representations are more effective than 2D representations for tracking in these settings, and we obtain state-of-the-art performance.

Installation

We recommend creating a clean conda environment and install all dependencies. You can do this as follows:

conda env create -f _environment.yml

After the installation is complete you can activate the conda environment by running:

conda activate T3DP

Install PyOpenGL from this repository:

pip uninstall pyopengl
git clone https://github.com/mmatl/pyopengl.git
pip install ./pyopengl

Additionally, install Detectron2 from the official repository, if you need to run demo code on a local machine. We provide detections inside the _DATA folder, so for running the tracker on posetrack or mupots, you do not need to install Detectron2.

Download Data

We provide preprocessed files for PoseTrack and MuPoTs datasets (AVA files will be released soon!). Please download this folder and extract inside the main repository.

Training

To train the transformer model with posetrack data run,

python train_t3dp.py
--learning_rate 0.001
--lr_decay_epochs 10000,20000
--epochs 100000
--tags T3PO
--train_dataset posetrack_2018
--test_dataset posetrack_2018
--train_batch_size 32
--feature APK
--train

WANDB will create unique names for each run, and save the model names accordingly. Use this name for evaluation. We have also provided pretrained weights inside the _DATA folder.

Testing

Once the posetrack dataset is downloaded at "_DATA/Posetrack_2018/", run the following command to run our tracker on all validation videos.

python test_t3dp.py
--dataset "posetrack"
--dataset_path "_DATA/Posetrack_2018/"
--storage_folder "Videos_Final"
--render True
--save True

Evaluation

To evaluate the tracking performance on ID switches, MOTA, and IDF1 metrics, please run the following command.

python3 evaluate_t3dp.py out/Videos_Final/results/ t3dp posetrack

Demo

Please run the following command to run our method on a youtube video. This will download the youtube video from a given ID, and extract frames, run Detectron2, run HMAR and finally run our tracker and renders the video.

python3 demo.py

Results (Project site)

We evaluated our method on PoseTrack, MuPoTs and AVA datasets. Our results show significant improvements over the state-of-the-art methods on person tracking. For more results please visit our website.

Acknowledgements

Parts of the code are taken or adapted from the following repos:

Contact

Jathushan Rajasegaran - [email protected] or [email protected]
To ask questions or report issues, please open an issue on the issues tracker.
Discussions, suggestions and questions are welcome!

Citation

If you find this code useful for your research or the use data generated by our method, please consider citing the following paper:

@Inproceedings{rajasegaran2021tracking,
  title     = {Tracking People with 3D Representations},
  author    = {Rajasegaran, Jathushan and Pavlakos, Georgios and Kanazawa, Angjoo and Malik, Jitendra},
  Booktitle = {NeurIPS},
  year      = {2021}
}

Comments
  • pyrender.OffscreenRenderer error

    pyrender.OffscreenRenderer error

    Thanks for your nice work! I run the demo code and pyrender always has some errors. When I set "os.environ['PYOPENGL_PLATFORM'] = 'egl'" , the error is: Traceback (most recent call last): File "demo.py", line 367, in test_tracker(opt, hmar_tracker) File "/opt/tiger/demo/T3DP/test_t3dp.py", line 178, in test_tracker make_video(HMAR_model, opt.save, opt.render, opt, video_name, new_visuals_dic)
    File "/opt/tiger/demo/T3DP/utils/make_video.py", line 180, in make_video rendered_image, _, _, _ = HMAR_model.render_3d(pose_data[loc_x].cuda(), center_data[loc_x] + [left, top], np.max(scale_data[loc_x], axis=1), max(img_height, img_width), color_data[loc_x], image=resized_image_bbox/255.0) File "/opt/tiger/demo/T3DP/models/hmar.py", line 164, in render_3d rgb_from_pred = self.neural_renderer.visualize_all(verts.cpu().numpy(), pred_cam_t.cpu().numpy(), color, image) File "/opt/tiger/demo/T3DP/models/renderer.py", line 57, in visualize_all color = self.call(verts, image=images_np, focal_length=fl, baseColorFactors=baseColorFactors) File "/opt/tiger/demo/T3DP/models/renderer.py", line 88, in call color, rend_depth = self.renderer.render(scene, flags=pyrender.RenderFlags.RGBA) File "/home/tiger/.local/lib/python3.7/site-packages/pyrender/offscreen.py", line 86, in render self._platform.make_current() File "/home/tiger/.local/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 198, in make_current self._egl_context File "/home/tiger/.local/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 12296, baseOperation = eglMakeCurrent, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7fa915562048>, <OpenGL._opaque.EGLSurface_pointer object at 0x7fa912db6c80>, <OpenGL._opaque.EGLSurface_pointer object at 0x7fa912db6c80>, <OpenGL._opaque.EGLContext_pointer object at 0x7fa7f5fad268>, ), result = 0 )

    When I set "#os.environ['PYOPENGL_PLATFORM'] = 'osmesa'", the error is: Traceback (most recent call last): File "demo.py", line 335, in run_hmar(dataset_path + video_folder) File "demo.py", line 197, in run_hmar HMAR_model = HMAR(config) File "/opt/tiger/demo/T3DP/models/hmar.py", line 76, in init self.neural_renderer = Renderer(focal_length=self.cfg.EXTRA.FOCAL_LENGTH, img_res=256, faces=self.faces_cpu) File "/opt/tiger/demo/T3DP/models/renderer.py", line 42, in init point_size=1.0) File "/home/tiger/.local/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in init self._create() File "/home/tiger/.local/lib/python3.7/site-packages/pyrender/offscreen.py", line 149, in _create self._platform.init_context() File "/home/tiger/.local/lib/python3.7/site-packages/pyrender/platforms/osmesa.py", line 34, in init_context self._context = OSMesaCreateContextAttribs(attrs, None) File "/home/tiger/.local/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 414, in call self.name, self.name, OpenGL.error.NullFunctionError: Attempt to call an undefined function OSMesaCreateContextAttribs, check for bool(OSMesaCreateContextAttribs) before calling

    opened by ifzhang 6
  • Could not found the SMPL model

    Could not found the SMPL model

    Tks for your great work, when I run python demo.py, get fellow error

    Traceback (most recent call last):
      File "demo.py", line 329, in <module>
        run_hmar(dataset_path + video_folder)
      File "demo.py", line 193, in run_hmar
        HMAR_model      = HMAR(config)
      File "/app/xxx/T3DP/models/hmar.py", line 74, in __init__
        create_transl=False)
      File "/app/xxx/T3DP/models/smplx/body_models.py", line 97, in create
        return SMPL(model_path, **kwargs)
      File "/app/xxx/T3DP/models/smplx/body_models.py", line 186, in __init__
        smpl_path)
    AssertionError: Path _DATA/models/smpl does not exist!
    

    could you update the link of the SMPL model in README

    opened by flywheel1412 3
  • Colab Fetch necessary data error.

    Colab Fetch necessary data error.

    Access denied with the following error:

    Cannot retrieve the public link of the file. You may need to change
    the permission to 'Anyone with the link', or have had many accesses. 
    

    You may still be able to access the file from the browser:

     https://drive.google.com/uc?id=1qfqkAjBWLZkZSywQz-KV_kVmeWqdm_QN 
    

    unzip: cannot find or open _DATA.zip, _DATA.zip.zip or _DATA.zip.ZIP.

    opened by xiaocc612 2
  • Code for HOTA?

    Code for HOTA?

    Dear Doc. Rajasegaran,

    Thanks for releasing the code! I am following your work recently. I have a question about the HOTA matrix. Did you use this implementation or other implementation? If you use other format, could you please provide the code for calculating HOTA ?

    opened by Arthur151 2
  • dataset

    dataset

    Hi, I would like to know how the images and annotations under the path "_DATA/Posetrack_2018/" need to be arranged after I download posetrack_2018 datasets? Thanks.

    opened by BryantGao 1
  • demo

    demo

    Traceback (most recent call last): File "demo.py", line 328, in run_hmar(dataset_path + video_folder) File "demo.py", line 193, in run_hmar HMAR_model = HMAR(config) File "/home/ybw/gaoz/T3DP/models/hmar.py", line 74, in init create_transl=False) File "/home/ybw/gaoz/T3DP/models/smplx/body_models.py", line 97, in create return SMPL(model_path, **kwargs) File "/home/ybw/gaoz/T3DP/models/smplx/body_models.py", line 212, in init self.faces = data_struct.f AttributeError: 'Struct' object has no attribute 'f'

    opened by BryantGao 0
  • Downloaded data can't be opened

    Downloaded data can't be opened

    Hi, doc Rajasegaran. The Downloaded Data : _Data/Posetrack_2018 can't be opened. I try to find Posetrack_2018 on the internet. The website https://posetrack.net also can't be opened right now.

    opened by YoungLee3204 0
  • About render_3d() method

    About render_3d() method

    The render_3d() method has an rot=False argument. https://github.com/brjathu/T3DP/blob/de6aeb603aedf59c1da587f3f60b8c4ead0a4f8a/models/hmar.py#L107

    It seems the argument prohibit the verts from being translated to world frame: https://github.com/brjathu/T3DP/blob/de6aeb603aedf59c1da587f3f60b8c4ead0a4f8a/models/hmar.py#L141-L151

    Is that right?

    opened by nnop 0
  • centos pyrender.OffscreenRenderer error

    centos pyrender.OffscreenRenderer error

    Hi, thanks for the great work. I want to know whether the centos can use pyrender.OffscreenRenderer,Or is there any other solution to solve the pyrender error in centos.

    opened by SeanLiu081 0
Owner
Jathushan Rajasegaran
Jathushan Rajasegaran
Inference code for "StylePeople: A Generative Model of Fullbody Human Avatars" paper. This code is for the part of the paper describing video-based avatars.

NeuralTextures This is repository with inference code for paper "StylePeople: A Generative Model of Fullbody Human Avatars" (CVPR21). This code is for

Visual Understanding Lab @ Samsung AI Center Moscow 18 Oct 6, 2022
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
A code repository associated with the paper A Benchmark for Rough Sketch Cleanup by Chuan Yan, David Vanderhaeghe, and Yotam Gingold from SIGGRAPH Asia 2020.

A Benchmark for Rough Sketch Cleanup This is the code repository associated with the paper A Benchmark for Rough Sketch Cleanup by Chuan Yan, David Va

null 33 Dec 18, 2022
Code repository for paper `Skeleton Merger: an Unsupervised Aligned Keypoint Detector`.

Skeleton Merger Skeleton Merger, an Unsupervised Aligned Keypoint Detector. The paper is available at https://arxiv.org/abs/2103.10814. A map of the r

北海若 48 Nov 14, 2022
Official code repository of the paper Learning Associative Inference Using Fast Weight Memory by Schlag et al.

Learning Associative Inference Using Fast Weight Memory This repository contains the offical code for the paper Learning Associative Inference Using F

Imanol Schlag 18 Oct 12, 2022
This repository holds the code for the paper "Deep Conditional Gaussian Mixture Model forConstrained Clustering".

Deep Conditional Gaussian Mixture Model for Constrained Clustering. This repository holds the code for the paper Deep Conditional Gaussian Mixture Mod

null 17 Oct 30, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

selfcontact This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] It includes the main function

Lea Müller 68 Dec 6, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

SMPLify-XMC This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] License Software Copyright Lic

Lea Müller 83 Dec 14, 2022
This repository contains the code for the paper "Hierarchical Motion Understanding via Motion Programs"

Hierarchical Motion Understanding via Motion Programs (CVPR 2021) This repository contains the official implementation of: Hierarchical Motion Underst

Sumith Kulal 40 Dec 5, 2022
null 190 Jan 3, 2023
This repository contains the source code and data for reproducing results of Deep Continuous Clustering paper

Deep Continuous Clustering Introduction This is a Pytorch implementation of the DCC algorithms presented in the following paper (paper): Sohil Atul Sh

Sohil Shah 197 Nov 29, 2022
This repository contains a re-implementation of the code for the CVPR 2021 paper "Omnimatte: Associating Objects and Their Effects in Video."

Omnimatte in PyTorch This repository contains a re-implementation of the code for the CVPR 2021 paper "Omnimatte: Associating Objects and Their Effect

Erika Lu 728 Dec 28, 2022
This repository contains the source code for the paper "DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks",

DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks Project Page | Video | Presentation | Paper | Data L

Facebook Research 281 Dec 22, 2022
Official repository with code and data accompanying the NAACL 2021 paper "Hurdles to Progress in Long-form Question Answering" (https://arxiv.org/abs/2103.06332).

Hurdles to Progress in Long-form Question Answering This repository contains the official scripts and datasets accompanying our NAACL 2021 paper, "Hur

Kalpesh Krishna 41 Nov 8, 2022
This repository contains the code and models for the following paper.

DC-ShadowNet Introduction This is an implementation of the following paper DC-ShadowNet: Single-Image Hard and Soft Shadow Removal Using Unsupervised

AuAgCu 65 Dec 27, 2022
The code repository for EMNLP 2021 paper "Vision Guided Generative Pre-trained Language Models for Multimodal Abstractive Summarization".

Vision Guided Generative Pre-trained Language Models for Multimodal Abstractive Summarization [Paper] accepted at the EMNLP 2021: Vision Guided Genera

CAiRE 42 Jan 7, 2023
This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Information Maximization for Multimodal Sentiment Analysis, accepted at EMNLP 2021.

MultiModal-InfoMax This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Informa

Deep Cognition and Language Research (DeCLaRe) Lab 89 Dec 26, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

TUCH This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] License Software Copyright License fo

Lea Müller 45 Jan 7, 2023
This is the code repository implementing the paper "TreePartNet: Neural Decomposition of Point Clouds for 3D Tree Reconstruction".

TreePartNet This is the code repository implementing the paper "TreePartNet: Neural Decomposition of Point Clouds for 3D Tree Reconstruction". Depende

刘彦超 34 Nov 30, 2022