Giter Site home page Giter Site logo

vlsomers / bpbreid Goto Github PK

View Code? Open in Web Editor NEW
146.0 2.0 16.0 10.22 MB

A strong baseline for body part-based person re-identification (check out our WACV23 paper)

License: Other

Shell 0.02% Python 98.98% Makefile 0.01% Cython 0.99%
computer-vision deep-learning person pytorch re-identification reid tracking wacv2023 person-reidentification reidentification

bpbreid's Introduction

BPBReID: Body Part-based (Occluded) Re-Identification

A strong baseline for body part-based person re-identification

[Paper] [Video] [Poster]

arXiv Hippocratic License HL3-LAW-MEDIA-MIL-SOC-SV

Body Part-Based Representation Learning for Occluded Person Re-Identification, WACV23

Vladimir Somers, Christophe De Vleeschouwer, Alexandre Alahi

arxiv 2211.03679

State-of-the-art performance on 5 datasets:

Occluded-Duke: PWC

Occluded ReID: PWC

P-DukeMTMC: PWC

DukeMTMC-ReID: PWC

Market1501: PWC

 

 

News

  • [2023.09.20] New paper and big update coming soon 🚀 ...
  • [2023.07.26] The Python script from @samihormi to generate human parsing labels based on PifPaf and MaskRCNN has been released, have a look at the "Generate human parsing labels" section below. This script is different from the one used by the authors (especially when facing multiple pedestrians in a single image): resulting human parsing labels will not be exactly the same.
  • [2023.06.28] Please find a non-official script to generate human parsing labels from PifPaf and MaskRCNN in this Pull Request. The PR will be merged soon.
  • [2022.12.02] We release the first version of our codebase. Please update frequently as we will add more documentation during the next few weeks.

What's next

We plan on extending BPBReID in the near future, put a star and stay updated for future changes:

  • part-based video/tracklet reid
  • part-based reid for multi-object tracking
  • ...

Table of content

Introduction

Welcome to the official repository for our WACV23 paper "Body Part-Based Representation Learning for Occluded Person Re-Identification". In this work, we propose BPBReID, a part-based method for person re-identification using body part feature representations to compute to similarity between two samples. As illustrated in the figure below, part-based ReID methods output multiple features per input sample, i.e. one for each part, whereas standard global methods only output a single feature. Compared to global methods, part-based ones come with some advantages:

  1. They achieve explicit appearance feature alignement for better ReID accuracy.
  2. They are robust to occlusions, since only mutually visible parts are used when comparing two samples.

Our model BPBreID uses pseudo human parsing labels at training time to learn an attention mechanism. This attention mechanism has K branches to pool the global spatial feature map into K body part-based embeddings. Based on the attention maps activations, visibility scores are computed for each part. At test time, no human parsing labels is required. The final similarity score between two samples is computed using the average distance of all mutually visible part-based embeddings. Please refer to our paper for more information.

What to find in this repository

In this repository, we propose a framework and a strong baseline to support further research on part-based ReID methods. Our code is based on the popular Torchreid framework for person re-identification. In this codebase, we provide several adaptations to the original framework to support part-based ReID methods:

  • The ImagePartBasedEngine to train/test part-based models, compute query-gallery distance matrix using multiple features per test sample with support for visibility scores.
  • The fully configurable GiLt loss to selectively apply id/triplet loss on holistics (global) and part-based features.
  • The BodyPartAttentionLoss to train the attention mechanism.
  • The BPBreID part-based model to compute part-based features with support for body-part learnable attention, fixed attention heatmaps from an external model, PCB-like horizontal stripes, etc.
  • The Albumentation data augmentation library used for data augmentation, with support for external heatmaps/masks transforms.
  • Support for Weights & Biases and other logging tools in the Logger class.
  • An EngineState class to keep track of training epoch, etc.
  • A new ranking visualization tool to display part heatmaps, local distance for each part and other metrics.
  • For more information about all available configuration and parameters, please have a look at the default config file.

You can also have a look at the original Torchreid README for additional information, such as documentation, how-to instructions, etc. Be aware that some of the original Torchreid functionnality and models might be broken (for example, we don't support video re-id yet).

Instructions

Installation

Make sure conda is installed.

# clone this repository
git clone https://github.com/VlSomers/bpbreid

# create conda environment
cd bpbreid/ # enter project folder
conda create --name bpbreid python=3.10
conda activate bpbreid

# install dependencies
# make sure `which python` and `which pip` point to the correct path
pip install -r requirements.txt

# install torch and torchvision (select the proper cuda version to suit your machine)
conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

# install torchreid (don't need to re-build it if you modify the source code)
python setup.py develop

Download human parsing labels

You can download the human parsing labels on GDrive. These labels were generated using the PifPaf pose estimation model and then filtered using segmentation masks from Mask-RCNN. We provide the labels for five datasets: Market-1501, DukeMTMC-reID, Occluded-Duke, Occluded-ReID and P-DukeMTMC. After downloading, unzip the file and put the masks folder under the corresponding dataset directory. For instance, Market-1501 should look like this:

Market-1501-v15.09.15
├── bounding_box_test
├── bounding_box_train
├── masks
│   └── pifpaf_maskrcnn_filtering
│       ├── bounding_box_test
│       ├── bounding_box_train
│       └── query
└── query

Make also sure to set data.root config to your dataset root directory path, i.e., all your datasets folders (Market-1501-v15.09.15, DukeMTMC-reID, Occluded_Duke, P-DukeMTMC-reID, Occluded_REID) should be under this path.

Generate human parsing labels

You can create human parsing labels for your own dataset using the following command:

conda activate bpbreid
python scripts/get_labels --source [Dataset Path] 

The labels will be saved under the source directory in the masks folder as per the code convention.

Download the pre-trained models

We also provide some state-of-the-art pre-trained models based on the HRNet-W32 backbone. You can put the downloaded weights under a 'pretrained_models/' directory or specify the path to the pre-trained weights using the model.load_weights parameter in the yaml config. The configuration used to obtain the pre-trained weights is also saved within the .pth file: make sure to set model.load_config to True so that the parameters under the model.bpbreid part of the configuration tree will be loaded from this file.

Inference

You can test the above downloaded models using the following command:

conda activate bpbreid
python scripts/main.py --config-file configs/bpbreid/bpbreid_<target_dataset>_test.yaml

For instance, for the Market-1501 dataset:

conda activate bpbreid
python scripts/main.py --config-file configs/bpbreid/bpbreid_market1501_test.yaml

Configuration files for other datasets are available under configs/bpbreid/. Make sure the model.load_weights in these yaml config files points to the pre-trained weights you just downloaded.

Training

Training configs for five datasets (Market-1501, DukeMTMC-reID, Occluded-Duke, Occluded-ReID and P-DukeMTMC) are provided in the configs/bpbreid/ folder. A training procedure can be launched with:

conda activate bpbreid
python ./scripts/main.py --config-file configs/bpbreid/bpbreid_<target_dataset>_train.yaml

For instance, for the Occluded-Duke dataset:

conda activate bpbreid
python scripts/main.py --config-file configs/bpbreid/bpbreid_occ_duke_train.yaml

Make sure to download and install the human parsing labels for your training dataset before runing this command.

Visualization tools

The ranking visualization tool can be activated by setting the test.visrank config to True. As illustrated below, this tool displays the Top-K ranked samples as rows (K can be set via test.visrank_topk). The first row with blue background is the query, and the following green/red rows indicated correct/incorrect matches. The attention maps for each test embedding (foreground, parts, etc) are displayed in the row. An attention map has a green/red border when it is visible/unvisible. The first number under each attention map indicate the visibility score and the second number indicate the distance of the embedding to the corresponding query embedding. The distances under the images in the first column on the left are the global distances of that sample to the query, which is usually computed as the average of all other distances weighted by the visibility score. If you need more information about the visualization tool, fell free to open an issue.

 

 

Other works

If you are looking for datasets to evaluate your re-identification models, please have a look at our other works on player re-identification for team sport events:

Questions and suggestions

If you have any question/suggestion, or find any bug/issue with the code, please raise a GitHub issue in this repository, I'll be glab to help you as much as I can! I'll try to update the documentation regularly based on your questions.

Citation

If you use this repository for your research or wish to refer to our method BPBReID, please use the following BibTeX entry:

@article{bpbreid,
    archivePrefix = {arXiv},
    arxivId = {2211.03679},
    author = {Somers, Vladimir and {De Vleeschouwer}, Christophe and Alahi, Alexandre},
    doi = {10.48550/arxiv.2211.03679},
    eprint = {2211.03679},
    isbn = {2211.03679v1},
    journal = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV23)},
    month = {nov},
    title = {{Body Part-Based Representation Learning for Occluded Person Re-Identification}},
    url = {https://arxiv.org/abs/2211.03679v1 http://arxiv.org/abs/2211.03679},
    year = {2023}
}

Acknowledgement

This codebase is a fork from Torchreid

bpbreid's People

Contributors

avn3r-dn avatar kaiyangzhou avatar layumi avatar luyao777 avatar rick-hao avatar samihormi avatar victorjoos avatar vlsomers avatar yu-wu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bpbreid's Issues

implementation of bpbreid

hello , i have tried the code from inference and tried to see the visualization as mentioned in the code but after following the instruction still i couldn't get the visualization ranking
what should i do for it ?

tensors is empty when use part_base_engine _feature_extraction

So I had this error :
TimeoutError:
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

when trying to run this script :"python scripts/main.py --config-file configs/bpbreid/bpbreid_market1501_test.yaml". And I tried to fix it by downloading the dataset from drive and set the directories as in your instruction
image
After that, everything runs just fine until it comes to _feature_extraction at part_based_engine.py and I'm not sure if data_loader is null or not(I'm totally new to Python) but the for loop isn't running at all.
"RuntimeError: torch.cat(): expected a non-empty list of Tensors".
I would appreciate if you could guide me a little bit.

dataset

hello please provide me the link to download occluded-reid dataset
thank you

Attention Heatmap Visualization

Hello, thank you for your amazing work! How can I visualize the attention heatmap for different body parts as well as the whole body? I think it should be under the path "torchreid/utils/visualization", but the code is a little bit hard to understand.. Can you offer me some guidances of doing so?

torch.cat()

Hey
I got this error after executing this command:
!python /content/bpbreid/torchreid/scripts/main.py --config-file configs/bpbreid/bpbreid_market1501_train.yaml
This error is displayed after the completion of train steps:
Traceback (most recent call last):
File "/content/bpbreid/torchreid/scripts/main.py", line 274, in
main()
File "/content/bpbreid/torchreid/scripts/main.py", line 183, in main
engine.run(**engine_run_kwargs(cfg))
File "/content/bpbreid/torchreid/engine/engine.py", line 245, in run
evalate_on_sources_only=False
File "/content/bpbreid/torchreid/engine/engine.py", line 349, in test
save_features=save_features
File "/usr/local/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/content/bpbreid/torchreid/engine/image/part_based_engine.py", line 188, in evaluate
qf, q_pids, q_camids, qf_parts_visibility, q_parts_masks, q_pxl_scores
, q_anns = self.feature_extraction(query_loader)
File "/content/bpbreid/torchreid/engine/image/part_based_engine.py", line 159, in feature_extraction
parts_visibility
= torch.cat(parts_visibility
, 0)
RuntimeError: torch.cat(): expected a non-empty list of Tensors

This is the dataset path:
/root/datasets/reid/Market-1501-v15.09.15

Non-existent config key

i get this error for inference
KeyError: 'Non-existent config key: training_binary_visibility_score'

shape error

I follow the instruction as you say, but I can't run the code
image

About test Occluded-ReID datasets

how can i test Occluded-ReID datasets with this codes, what should do for cfg, my bpbreid_occ_reid_test.yaml like this
data:
root: '/root/bpbreid-main_modify/datasets/reid'
sources: ['market1501']
targets: ['occluded_reid']
height: 384
width: 128
transforms: ['rc', 're']

model:
name: 'bpbreid'
load_weights: 'pretrained_models/'
load_config: True
bpbreid:
mask_filtering_training: False
mask_filtering_testing: True
learnable_attention_enabled: True
backbone: 'hrnet32'
test_embeddings: ['bn_foreg', 'parts']
masks:
dir: 'pifpaf_maskrcnn_filtering'
preprocess: 'five_v'

test:
evaluate: True
batch_size: 4
visrank: True

and my dir likes this
datasets
——reid
————Market-1501-v15.09.15
——whole_body_images
——occluded_body_images
——masks
___pifpaf
——occluded_body_images
——whole_body_images
thanks !

preprocessing

Thanks for sharing this, fantastic.
Just saw in the readme that you are planning to share the scripts to preprocess other re-id datasets, i.e. to create the masks.
Any news on this front? Is there a chance you can share them already?

get_labels.py

If my goal is not the category of people, how should I modify it? For this get_labels.py label script file, generate my own labels . thanks!

A mismatch between the number of classes in the preds tensor and the num_classes parameter in the Accuracy

I hope you are doing well. I am trying to train Market1501 on your model BPBreID, and I set the init() function as follows:

'self.pred_accuracy = Accuracy(top_k=1, task='multiclass', num_classes=751)'
However, I encountered the following error message:
((=> Start training
pixels_cls_scores shape: torch.Size([98304, 6])
pixels_cls_score_targets shape: torch.Size([98304])
Traceback (most recent call last):
File "scripts/main.py", line 278, in
main()
File "scripts/main.py", line 183, in main
engine.run(**engine_run_kwargs(cfg))
File "/reid/bpbreid-main/torchreid/engine/engine.py", line 206, in run
open_layers=open_layers
File "/reid/bpbreid-main/torchreid/engine/engine.py", line 268, in train
loss, loss_summary = self.forward_backward(data)
File "/reid/bpbreid-main/torchreid/engine/image/part_based_engine.py", line 96, in forward_backward
bpa_weight=self.losses_weights[PIXELS]['ce'])
File "/reid/bpbreid-main/torchreid/engine/image/part_based_engine.py", line 127, in combine_losses
bpa_loss, bpa_loss_summary = self.body_part_attention_loss(pixels_cls_scores, pixels_cls_score_targets)
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/reid/bpbreid-main/torchreid/losses/body_part_attention_loss.py", line 40, in forward
pixels_cls_loss, pixels_cls_accuracy = self.compute_pixels_cls_loss(pixels_cls_scores, targets)
File "/reid/bpbreid-main/torchreid/losses/body_part_attention_loss.py", line 54, in compute_pixels_cls_loss
accuracy = self.pred_accuracy(pixels_cls_scores, pixels_cls_score_targets)
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torchmetrics/metric.py", line 236, in forward
self._forward_cache = self._forward_reduce_state_update(*args, **kwargs)
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torchmetrics/metric.py", line 302, in _forward_reduce_state_update
self.update(*args, **kwargs)
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torchmetrics/metric.py", line 390, in wrapped_func
update(*args, **kwargs)
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torchmetrics/classification/stat_scores.py", line 316, in update
preds, target, self.num_classes, self.multidim_average, self.ignore_index
File "/anaconda3/envs/torchreid/lib/python3.7/site-packages/torchmetrics/functional/classification/stat_scores.py", line 272, in _multiclass_stat_scores_tensor_validation
"If preds have one dimension more than target, preds.shape[1] should be"
ValueError: If preds have one dimension more than target, preds.shape[1] should be equal to the number of classes.))

So, can you please tell me how we could overcome the error related to the mismatch between the number of classes in the preds tensor and the num_classes parameter in the Accuracy metric? Is the num_classes for Market1501, not 751?

Many thanks,
GH

Feature extractor!

Thanks for the great work on this topic!

When trying to retrieve features using tools/feature_extractor, passing in masks = [np.load(image_mask.npy)] leads to image/mask dimensions mismatch error. I assume this didn't work because .npy stores the contour points?

How should we pass in the masks parameter to the feature extractor to actually give us the bpbreid features? - Thanks!

Feature extraction - improving comparison

Quick question -

For the masks, is there a difference using the confidence field .npy vs the mask generated from RCNN? I am getting similar foreground similarities for images representing different people (trying both versions of the masks), where the people are facing front (the camera) and the body parts are visible...

Thanks for the great work again!

ClearML

image
Hi author I don't know how to fix it.

Hello, Vladimir ;How to solve this problem, thanks

root@3e426b2db9fe:/home/bpbreid-main/scripts# python get_labels.py --source [ABSK]
/usr/local/lib/python3.8/dist-packages/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.16) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported "

  • OpenPifPaf model -> shufflenetv2k16
    Traceback (most recent call last):
    File "get_labels.py", line 521, in
    main()
    File "get_labels.py", line 511, in main
    pifpaf_model(imagery=img_paths, dataset_dir=args.source, is_overwrite=False)
    File "get_labels.py", line 212, in call
    assert len(imagery) > 0, "No images found in imagery."
    AssertionError: No images found in imagery.

About Code

I am very interested in your research, can you open source as soon as possible and publish the code details?

Thanks!

python scripts/get_labels.py --source ./ABSK

Hello, author; Can you help me solve this problem?

(bpbreid1) D:\downloads\bpbreid-main>python scripts/get_labels.py --source ./ABSK

  • OpenPifPaf model -> shufflenetv2k16
    Processing: 0batch [00:00, ?batch/s]
  • MaskRCNN model -> COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml
    Processing: 0%| | 0/130 [00:00<?, ?batch/s]D
    :\Anaconda\envs\bpbreid1\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:3191.)
    return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
    Processing: 2%|████ | 3/130 [04:35<3:15:13, 92.23s/batch]Traceback (most recent call last):
    File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 521, in
    main()
    File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 517, in main
    mask_model(imagery=img_paths, dataset_dir=args.source, is_overwrite=False)
    File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 392, in call
    pifpaf_filtered: List[np.ndarray] = self.__filter_pifpaf_with_mask(batch, pifpaf_file_paths)
    File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 475, in __filter_pifpaf_with_mask
    masks = filter_masks(self.model(batch))
    File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 444, in filter_masks
    filtered_boxes, filtered_masks = zip(
    ValueError: not enough values to unpack (expected 2, got 0)
    Processing: 2%|████ 3/130 [06:06<4:18:55, 122.32s/batch]

p_duke training error

fcbb6fb0739c7dbf8608988f6e8fedb Hi, author I'm training on the p_duke dataset but there is an error. I don't know how to fix it.

OSNet Support ?

Hello Authors,

Thank you for creating this repository and I have explored it. I'd like to know whether we only need to replace ResNet50 with OSNet to support the OSNet model, or if we need to make additional changes to the settings. I am eagerly awaiting your response.

Thank you.

Shape different between pif and paf

Hi authors,
Thanks for sharing your code. I trained the model. Every thing works normally.
I want to generate human parsing masks. I got the error when concatenating the confidence scores for keypoints and connections. The size of pif is (17, 5, 17, 9) and the size of paf is (19, 9, 17, 9). Is it normal that I get different shape of pif and paf. How could I concatenate their confidence score? Hope to receive your advice. Thank you in advance.

Find the dataset but Can`t read the dataset rightly

Hello, what is the reason why the program can find the dataset but cannot read it correctly, the following is the content of the dataset I read:
Creating new dataset market1501 and add it to the datasets cache.
Loading train (source) dataset
Creating new dataset market1501 and add it to the datasets cache.
=> Loaded Market1501

subset | # ids | # images | # cameras

train | 0 | 0 | 0
query | 0 | 0 | 0
gallery | 0 | 0 | 0

=> Loading test (target) dataset
Using cached dataset market1501.
Using cached dataset market1501.

**************** Summary ****************
source : ['market1501']

source datasets : 1

source ids : 0

source images : 0

source cameras : 0

target : ['market1501']


Building model: bpbreid
=> init weights from normal distribution
Loading pretrained ImageNet HRNet32 model at pretrained_models/hrnetv2_w32_imagenet_pretrained.pth
=> loading pretrained model pretrained_models/hrnetv2_w32_imagenet_pretrained.pth
/home/Anaconda-env/bpbreid/lib/python3.9/site-packages/torch/nn/init.py:405: UserWarning: Initializing zero-element tensors is a no-op
warnings.warn("Initializing zero-element tensors is a no-op")
Model complexity: params=34,848,838 flops=8,000,198,656
Successfully loaded pretrained weights from "/home/WYF/BPBReID/bpbreid-main/pretrained_models/bpbreid_market1501_hrnet32_10642.pth"
** The following layers are discarded due to unmatched keys or layer size: ['global_identity_classifier.classifier.weight', 'background_identity_classifier.classifier.weight', 'foreground_identity_classifier.classifier.weight', 'concat_parts_identity_classifier.classifier.weight', 'parts_identity_classifier.0.classifier.weight', 'parts_identity_classifier.1.classifier.weight', 'parts_identity_classifier.2.classifier.weight', 'parts_identity_classifier.3.classifier.weight', 'parts_identity_classifier.4.classifier.weight']
Building part_based-engine for image-reid
Starting experiment 3cdb81db-1431-4221-8e47-408497a470ef with job id 778978385 and creation date 2024_05_12_03_13_36_13S

Evaluating market1501 (source)

Extracting features from query set ...
Batches processed: 0it [00:00, ?it/s]
Traceback (most recent call last):
File "/home/WYF/BPBReID/bpbreid-main/torchreid/scripts/main.py", line 274, in
main()
File "/home/WYF/BPBReID/bpbreid-main/torchreid/scripts/main.py", line 183, in main
engine.run(**engine_run_kwargs(cfg))
File "/home/WYF/BPBReID/bpbreid-main/torchreid/engine/engine.py", line 176, in run
self.test(
File "/home/WYF/BPBReID/bpbreid-main/torchreid/engine/engine.py", line 334, in test
cmc, mAP, ssmd, avg_pxl_pred_accuracy = self._evaluate(
File "/home/Anaconda-env/bpbreid/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/WYF/BPBReID/bpbreid-main/torchreid/engine/image/part_based_engine.py", line 188, in evaluate
qf, q_pids, q_camids, qf_parts_visibility, q_parts_masks, q_pxl_scores
, q_anns = self.feature_extraction(query_loader)
File "/home/WYF/BPBReID/bpbreid-main/torchreid/engine/image/part_based_engine.py", line 159, in feature_extraction
parts_visibility
= torch.cat(parts_visibility
, 0)
RuntimeError: torch.cat(): expected a non-empty list of Tensors

openpifpaf

Using Openpifpaf to train one's own dataset and how to obtain the model in the program? thanks

ONNX export?

Hello, is there any option to export the model to ONNX in similar fashion like original deep-reid repo?

PS: Kudos to great work!:)

python scripts of human parsing labels

Hi. I want to run this model on other datasets, but it doesn't have human parsing labels and I don't know how to build it. Can you share the python scripts of building human parsing labels? Best wishes.

Question about reproducing results with resnet backbone

Hello, Vladimir. I followed your paper and changed the backbone to resnet and the input size to 256*128. I repeated the experiment twice and attached the results below:
image
image

The rank1 is similar, but the mAP is lower. Could you please tell me what other settings I need to change? Thank you for your help.

About generating human parsing labels

Thans for releasing the code!
As decribed in the README file, the labels of human parsing were generated using the PifPaf pose estimation model and then filtered using segmentation masks from Mask-RCNN. Could you please give me some details about the operation "filter", thanks

Trained models

Are you planning to provide trained models at some point?

hi author

  I want to run this model on other datasets, but it doesn't have human parsing labels and I don't know how to build it. Can you share the python scripts of building human parsing labels? Best wishes.

Loss

Hello, Vladimir. When I tried to train the model using the Market dataset, I encountered this issue. Could you please assist me in investigating this matter?
屏幕截图 2024-06-06 110612

About BodyPartAttentionLoss

Hello, thanks for your briliant contribution!
I encounterd a confusing problem. When I using BodyPartAttentionLoss as my loss function, the generated mask can't differentiate between left leg and right leg, left arm and right arm. Have you encountered same problems? How did you solved that ?

Mask generator

Hello,
I'm asking about how to generate a mask which shape: .npy contains a 36xHxW array (H and W).

  1. What is H,W in this case?
  2. I tried to extract data from OpenPifPaf but it's only return keypoint, how did you get value for joints? Alternative, I use this script to calculate it:
    keypoints = predictions[0].data for x, y in predictions[0].skeleton: joint_array = (keypoints[x-1]+ keypoints[y-1])/2

Simple demo

Hi, Can you provide a simple demo? input 2 image and 2 mask, output all distances. Thank you!

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.