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

Creating centroids #19

Open
wlamers opened this issue Mar 16, 2022 · 4 comments
Open

Creating centroids #19

wlamers opened this issue Mar 16, 2022 · 4 comments

Comments

@wlamers
Copy link

wlamers commented Mar 16, 2022

Shouldn't

if cfg.MODEL.USE_CENTROIDS:

in file create_embeddings be?:

if cfg.MODEL.KEEP_CAMID_CENTROIDS:

And to run on GPU put the model on the GPU with:
model.to("cuda")

@mikwieczorek
Copy link
Owner

  1. No, as these flags control different things. 1st one controls whether to use Centroids or plain embeddings per photo. 2nd is used only in ReID dataset for validation.
  2. It is done in inference/inference_utils.py line 119

@wlamers
Copy link
Author

wlamers commented Mar 17, 2022

Thanks for your quick reply!

  1. Ok then I mis understood the code. What I'm trying to do is extract embeddings from multile images from the same person and then use that for inference (in get_similar.py). I will revert back and add MODEL.USE_CENTROIDS to the config file (changing it from default False to True).

  2. Line 119 is empty both in my local repo as on Github, neither it is somewhere in the neighbourhood of 119. The data is indeed moved to the GPU buth not the model. Are we looking at the same code? Or am I misseng something else maybe?

Thanks again for your help.

@mikwieczorek
Copy link
Owner

  1. If you use Centroids it is important to specify exctract_func. Examples are here https://github.com/mikwieczorek/centroids-reid/blob/main/inference/create_embeddings.py#L29
  2. I was looking at my local fixed code. The change is already merged. Should be fine now.

@gmt710
Copy link

gmt710 commented Mar 22, 2022

Hello,Thx for your job.
If I want to add centroid as a plugin to my model training, how can I do it?
I would be very grateful if I could receive your reply.

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

No branches or pull requests

3 participants