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 can I create image embeddings of size 256? #36

Closed
monajalal opened this issue Oct 18, 2021 · 2 comments
Closed

How can I create image embeddings of size 256? #36

monajalal opened this issue Oct 18, 2021 · 2 comments

Comments

@monajalal
Copy link

Thanks for your great work. I noticed that smallest image embedding pertains to ResNet18 which is 512. Do you have any suggestion for a proper model that could lead to feature size of 256?

@christiansafka
Copy link
Owner

I recently used this efficientNet autoencoder for a different project: lukemelas/EfficientNet-PyTorch#257

The vector length was around 218. Would consider adding that to this repo when I find the time.

If you need exactly 256 you could also try dimensionality reduction on the 512 vector. For example use PCA to reduce from 512 -> 256.

@frutik
Copy link

frutik commented Oct 31, 2021

from sklearn.decomposition import PCA

pca = PCA(n_components=256)
vectors_256d = pca.fit_transform(list_of_all_your_vectors_512d)

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