GraphNN-Multi-Object-Tracking icon indicating copy to clipboard operation
GraphNN-Multi-Object-Tracking copied to clipboard

How do i need to get the PCA model

Open PerfectVeo opened this issue 4 years ago • 1 comments

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

PerfectVeo avatar Mar 28 '20 13:03 PerfectVeo

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.

selflein avatar Mar 28 '20 16:03 selflein