PAIR-code / what-if-tool

Source code/webpage/demos for the What-If Tool
https://pair-code.github.io/what-if-tool
Apache License 2.0
923 stars 170 forks source link

How is shape of imags/distance_embeddings.json file is [[250,1024]]? #174

Open brrbaral opened 3 years ago

brrbaral commented 3 years ago

Hi James and the Team! I am using WIT for web project. I got problem when using the distance_embeddings of shape [[300,300]] for displaying 300 example images. It shows error as "Uncaught (in promise) Error: Element arr[232] should have 300 elements, but has 1024 elements". But it worked fine while using array of [[300,1024]]. I got cosine distance among each images of set 300 as [[300,300]]. Please correct me where i made a mistake. Thanks.

jameswex commented 3 years ago

Thanks for reaching out. Are you able to share code that reproduces the error? The distance embeddings in the image demo are just used so we can have a custom distance metric for display purposes and calculating closest counterfactuals. Note that they aren't a required piece of using the tool with images.