Giter Site home page Giter Site logo

2022-tip-hcga's Introduction

PWC

Human Co-Parsing Guided Alignment for Occluded Person Re-identification (IEEE T-IP 2023)

This is the Pytorch implementation of the paper. More information about the paper is in here.

We propose a novel Human Co-parsing Guided Alignment (HCGA) framework that alternately trains the human co-parsing network and the ReID network, where the human co-paring network is trained in a weakly supervised manner to obtain paring results without any extra annotation.

HCGA

Installation

Clone this repository and install its requirements.

conda create -n hcga
conda activate hcga
conda install -c pytorch faiss-gpu

# For RTX 3090 and Tesla A100, we use CUDA 11.1.
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html

git clone https://github.com/Vill-Lab/2022-TIP-HCGA
cd 2022-TIP-HCGA
pip install -r requirements.txt

Reproducing the results

  1. Prepare the ReID datasets

  2. Download the pre-trained HRNet32 on ImageNet from Model, code: r1o2.

  3. The following command will train HCGA on Occluded-Duke.

bash HCGA-OD.sh

Note: use GPU multi-process need large memory and GPU Memory (We use RTX 3090 with 24GB).

  1. Test
bash Test-OD.sh

Reference

We hope that this technique will benefit more computer vision related applications and inspire more works. If you find this technique and repository useful, please cite the paper. Thanks!

@article{hcga23tip,
  author={Dou, Shuguang and Zhao, Cairong and Jiang, Xinyang and Zhang, Shanshan and Zheng, Wei-Shi and Zuo, Wangmeng},
  journal={IEEE Transactions on Image Processing}, 
  title={Human Co-Parsing Guided Alignment for Occluded Person Re-Identification}, 
  year={2023},
  volume={32},
  pages={458-470},
  doi={10.1109/TIP.2022.3229639}}

2022-tip-hcga's People

Contributors

shuguang-52 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yu9s

2022-tip-hcga's Issues

An issue when executing the command bash HCGA-Market1501.sh

I followed the steps in the readme to reproduce the process. However, I encountered an issue when executing the command bash HCGA-Market1501.sh, as I am unable to initiate training. Could you please help me identify the problem?

image

warnings.warn("Detected call of lr_scheduler.step() before optimizer.step(). "

torch.Size([128, 3, 256, 128])
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% -:--:--
Traceback (most recent call last):
File "/data/lwh22/project/2022-TIP-HCGA-main/tools/train.py", line 129, in
main()
File "/data/lwh22/project/2022-TIP-HCGA-main/tools/train.py", line 125, in main
train(cfg, num_gpus)
File "/data/lwh22/project/2022-TIP-HCGA-main/tools/train.py", line 72, in train
do_train(
File "/data/lwh22/project/2022-TIP-HCGA-main/./engine/trainer.py", line 627, in do_train
trainer.run(train_loader, max_epochs=epochs)
File "/data/lwh22/anaconda3/envs/hcga/lib/python3.9/site-packages/ignite/engine/engine.py", line 359, in run
self._handle_exception(e)
File "/data/lwh22/anaconda3/envs/hcga/lib/python3.9/site-packages/ignite/engine/engine.py", line 324, in _handle_exception
raise e
File "/data/lwh22/anaconda3/envs/hcga/lib/python3.9/site-packages/ignite/engine/engine.py", line 345, in run
self._fire_event(Events.EPOCH_STARTED)
File "/data/lwh22/anaconda3/envs/hcga/lib/python3.9/site-packages/ignite/engine/engine.py", line 259, in _fire_event
func(self, *(event_args + args), **kwargs)
File "/data/lwh22/project/2022-TIP-HCGA-main/./engine/trainer.py", line 480, in adjust_mask_pseudo_labels
feats, pseudo_labels_paths, pids, shape = compute_features(clustering_loader, model, device, with_arm)
File "/data/lwh22/project/2022-TIP-HCGA-main/./engine/trainer.py", line 170, in compute_features
batch_feats = model(batch_img, compute_futures=True)
File "/data/lwh22/anaconda3/envs/hcga/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'compute_futures'

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.