KaiyangZhou / deep-person-reid

Torchreid: Deep learning person re-identification in PyTorch.
https://kaiyangzhou.github.io/deep-person-reid/
MIT License
4.31k stars 1.15k forks source link

Prediction using Torchreid #401

Open BakingBrains opened 3 years ago

BakingBrains commented 3 years ago

In tensorflow/pytorch we use model.predict() for input image, Is there any similar way in torchreid? or How can we predict sequence of output from input image for person-ReID.

KaiyangZhou commented 3 years ago

Hope you have solved the problem.

This might help https://kaiyangzhou.github.io/deep-person-reid/user_guide.html#use-torchreid-as-a-feature-extractor-in-your-projects

ManuFU commented 3 years ago

After using the FeatureExtractor on an image with the size (480,720), i get back a tensor of size (1, 512). I would expect to get back something with the same size of the image.

SanjayJShanbhag commented 3 years ago

How can I convert osnet to a classifier for person classification? Basically I want to train a 2 class person classifier. Is it that I jus need a softmax layer at the output?

ManuFU commented 3 years ago

How can I convert osnet to a classifier for person classification? Basically I want to train a 2 class person classifier. Is it that I jus need a softmax layer at the output?

i suggest that you detect the persons (detectron2), cut them out of the image, use torchreid's feature extractor and finally calculate the euclidean distance between the feature and the target person's feature. if the distance of small, the probability is high, that it is your target

SanjayJShanbhag commented 3 years ago

Thank you for your response But I'm not looking for feature extraction method ,I want to build a single classifier ,say by adding a softmax layer at the end. So, Is it possible to create a classfier like the one mentioned above. Eagerly waiting for your reply.

Thanks in advance

On Thu, 8 Apr, 2021, 10:12 pm ManuFU, @.***> wrote:

How can I convert osnet to a classifier for person classification? Basically I want to train a 2 class person classifier. Is it that I jus need a softmax layer at the output?

i suggest that you detect the persons (detectron2), cut them out of the image, use torchreid's feature extractor and finally calculate the euclidean distance between the feature and the target person's feature. if the distance of small, the probability is high, that it is your target

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KaiyangZhou/deep-person-reid/issues/401#issuecomment-815975169, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMAZRDMQ5DC6EGEHPUG66BLTHXMIRANCNFSM4VEGMQ2A .

--

To know more on us, Please click on any of the following links;

https://www.facebook.com/acharya.ac.in https://www.youtube.com/user/acharya7317 https://twitter.com/acharya_ac_in https://instagram.com/acharyainstitutes?igshid=1btp5rq4kk6qy https://in.linkedin.com/school/acharya-institutes/ https://www.acharya.ac.in/

Disclaimer

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. It may also contain privileged or right protected information / work.  Use discretion in their appropriate use and sharing.  When in doubt, personally confirm with the sender. Although Acharya Institutes has taken reasonable precautions to ensure no viruses are present in this email, it cannot accept responsibility for any loss or damage arising from the use of this email or attachments. The recipient should adequate 'virus-check' before view / download / use.

luciferstar66 commented 2 years ago

How can I convert osnet to a classifier for person classification? Basically I want to train a 2 class person classifier. Is it that I jus need a softmax layer at the output?

i suggest that you detect the persons (detectron2), cut them out of the image, use torchreid's feature extractor and finally calculate the euclidean distance between the feature and the target person's feature. if the distance of small, the probability is high, that it is your target

to calculate the euclidean distance between the feature and the target person's feature it needs 2dim tensor but features extractor does not output 2dim tensor

mrsadeghi commented 1 year ago

How can I convert osnet to a classifier for person classification? Basically I want to train a 2 class person classifier. Is it that I jus need a softmax layer at the output?

i suggest that you detect the persons (detectron2), cut them out of the image, use torchreid's feature extractor and finally calculate the euclidean distance between the feature and the target person's feature. if the distance of small, the probability is high, that it is your target

to calculate the euclidean distance between the feature and the target person's feature it needs 2dim tensor but features extractor does not output 2dim tensor

I have the same problem. did you find any solution?

a2082761 commented 9 months ago

@luciferstar66 Did you find any solution...?