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

How do i need to get the PCA model #1

Open
PerfectVeo opened this issue Mar 28, 2020 · 1 comment
Open

How do i need to get the PCA model #1

PerfectVeo opened this issue Mar 28, 2020 · 1 comment

Comments

@PerfectVeo
Copy link

As the title indicates, I hope to get your help, thank you!

@selflein
Copy link
Owner

There is a function to create the PCA model and save it to disk in src/preprocessing which is fit_pca(save_path: str, dataset_path: str, re_id_net). You can call that method from the Python REPL.
re_id_net should be an instance of a reidentification model from torchreid. You can load the model like this:

from torchreid.models.osnet import osnet_x0_5
net = osnet_x0_5(pretrained=True)
net.eval()

And then run the method to obtain the PCA model:

fit_pca('path_to_where_to_save/pca.sklearn', 'path_to_MOT16_folder', net)

Another option would be to remove the entire PCA part in the preprocessing script and save the output features without dimensionality reduction, i.e., 512 dimensional features instead of 32, then change the MLP processing the re-id features from taking 32 to 512 dimensional input. However, I did not experiment with that approach and the original paper learns the re-id model end-to-end, so I am not sure how this will work out.

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

2 participants