Hi @garvitg , I got question regarding

Hi @garvitg , I got question regarding the workers ai and vectorize, I have an app running Resnet50 to vectorize image, I'm planning to switch over to cloudflare since you guys support Resnet50, however, I saw the limitiations of the Vectorize it says it has maximum dimensions per vector 1536 dimensions, which is not high enough for my app since it generate 2048 dimensions using Resnet50, any idea how can I reduce the dimensions that is generated from Resnet50? I'm really new to this field, so any help would be awesome, thanks!
3 Replies
garvitg
garvitg3mo ago
Hi @meh. Thanks for reaching out! You are correct in your understanding of the current Vectorize dimensionality limit of 1536. Unfortunately, this is a hard limit for now and there may not be a trivial solution. I am curious about how you are configuring the Workers AI Resnet50 model to generate embeddings, since that is not the default output configuration. If you have the ability to modify the layers in your model, you could possibly update the output layer to have 1536 neurons instead of 2048 or add a new linear layer with 1536 neurons. This would result in an output of embeddings with 1536 dimensions that could be inserted in a Vectorize index. Another option could be to use a different image model or another Resnet variant which could generate lower-dimensional embeddings. If your image corpus isn't too large, you could possibly use a dimensionality reduction technique such as PCA to bring down the dimensionality to 1536. There could be other potential solutions. I can discuss your use-case with the rest of the team on Monday, and get back to you if we come up with any feasible alternatives. We are happy to record your feedback in the meantime, and review the 1536-dimensions limit.
meh
mehOP3mo ago
Hi @garvitg, thanks for the answer, yeah I haven't test the Resnet50 on cloudflare, turns out it just image classification, I thought I can use it alongside with pytorch like Weaviate did with their image2vec and saved it into vectorize. However, based on this use case, is it possible to run image-to-vec in cloudflare worker afterall? And thanks if you can bring this to the team, the way I see it is if I could bring my own vector by generating it on my own then save it to vectorize, but still, the limit of 1536 will be the pain point.
garvitg
garvitg2mo ago
We have recorded your feedback both for the support of image embeddings models and for Vectorize to support indexes with dimensions greater than 1536.

Did you find this page helpful?