Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

person re-identification example #1699

Closed
josefhernandez opened this issue Aug 12, 2021 · 2 comments
Closed

person re-identification example #1699

josefhernandez opened this issue Aug 12, 2021 · 2 comments
Labels

Comments

@josefhernandez
Copy link

This is a feature request to create an example of the person re-identificacion algorithm

I'm executing YOLO in a live stream
And then when I try to execute the algorithm on each detected person:

reid = resnet50(ctx=ctx, pretrained = False)
reid.load_parameters('params/resnet50.params', ctx=ctx, allow_missing=True_, ignore_extra=True)

reid_normalizer = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
transform = transforms.Compose([
                    transforms.Resize(size=(128, 384), interpolation=1),
                    transforms.ToTensor(), 
                    reid_normalizer])
... YOLO ...
person = transform(person)
results = reid(person)    

I get the following error:

MXNetError: Check failed: dshp.ndim() == 4U (3 vs. 4) : Input data should be 4D in batch-num_filter-y-x

Who can I put multiple images (one for each person) into a 4D batch ?

@dai-ichiro
Copy link

if one image, you can use expand_dims.
if multiple images, you can use gluoncv.data.batchify.Stack.

hope this helps.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants