In[]:=
textEncoder=NetModel[{"CLIP Multi-domain Feature Extractor","InputDomain"->"Text","Architecture"->"ViT-L/14"}];
In[]:=
results=URLExecute[HTTPRequest["https://knn.laion.ai/knn-service",Method->"POST","Body"ExportString[<|"indice_name"->"laion5B-L-14",(*"text""cat",*)"embedding_input"->Normalize[textEncoder["A cat in a party hat"]],"deduplicate"->True,"use_violence_detector"->True,"use_safety_model"->True,"use_mclip"->False,"aesthetic_score"->9,"aesthetic_weight"->.5,"modality"->"image","num_images"->40,"num_result_ids"->40|>,"JSON"]],"RawJSON"];
In[]:=
results
Out[]=
captioncat-portraits (25),urlhttps://slojno.com/wp-content/uploads/2016/06/cat-portraits-25.jpg,id5044784318,similarity0.581178,captionGatto con cappello da festa,urlhttps://img.freepik.com/foto-gratuito/gatto-con-cappello-da-festa_1339-62564.jpg?size=338&ext=jpg,id5437776431,similarity0.578465,captionBirthday Hat Vector - Birthday Party Hat Cartoon, HD Png Download, Free Download,urlhttps://www.kindpng.com/picc/m/470-4705923_birthday-hat-vector-birthday-party-hat-cartoon-hd.png,id2820762435,similarity0.577178,captionBritish Short Hair Cat In Room,urlhttps://as1.ftcdn.net/jpg/00/70/49/56/220_F_70495691_aMpT1EuZrzTcrJxc1G0gOc9gkOb0k63A.jpg,id3804210644,similarity0.575927,captionChat avec chapeau de fête Photo Premium,urlhttps://image.freepik.com/photos-gratuite/chat-chapeau-fete_1339-61449.jpg,id5519376534,similarity0.575525,captionsmall resolution of party hat birthday hat cone png,urlhttps://i0.wp.com/banner2.kisspng.com/20190709/wxa/kisspng-party-hat-birthday-portable-network-graphics-clip-download-party-hat-png-file-png-format-birthday-5d241b5ab876d5.4375217715626473867556.jpg?w=500,id3077107986,similarity0.573583,captionChat avec chapeau de fête,urlhttps://img.freepik.com/photos-gratuite/chat-chapeau-fete_1339-562.jpg?size=338&ext=jpg,id4773939122,similarity0.572106,captionbirthday hat birthday hat craft crafts firstpalette,urlhttp://tse4.mm.bing.net/th?id=OIP.vVeT5uYcmwAjIylaSgqLuAHaLH,id4261336500,similarity0.571826,captioncute birthday kitten,urlhttps://thumb1.shutterstock.com/image-photo/stock-photo-cute-birthday-kitten-450w-39818440.jpg,id2433647569,similarity0.570767,captionВідмінна добірка котів (130 фото),urlhttp://sebat.org.ua/images/cats_82.jpg,id4004780627,similarity0.570373,caption8 Chapeaux de fête en carton petite coccinelle rose,urlhttps://cdn.vegaooparty.com/images/rep_art/list/321/7/321705/8-chapeaux-de-fete-en-carton-petite-coccinelle-rose_321705.jpg,id4805931820,similarity0.570231,captioncute happy birthday images with cats,urlhttps://happybirthdaymsgs.com/wp-content/uploads/2021/05/cute-happy-birthday-images-with-cats.jpg,id2835582162,similarity0.570188,captionBLACK AND WHITE PARTY CAT : Stock Photo,urlhttp://media.gettyimages.com/photos/-picture-id10074267?s=170667a,id2045263619,similarity0.570093,captionBritish Short hair cat in room,urlhttps://t1.ftcdn.net/jpg/00/71/09/98/240_F_71099848_rfs4RP17Mo2b2qbwxz39pC6hhEmOoqjV.jpg,id5233567088,similarity0.569662,captionQuem é o seu gato na festa de família?,urlhttps://static1.webedia.fr/game/1/67/41/@/image1-60abf32d8c825-350x250-1.jpg,id3607528936,similarity0.56941,captionKatze mit partyhut,urlhttps://img.freepik.com/fotos-kostenlos/katze-mit-partyhut_1339-560.jpg?size=626&ext=jpg,id5363657290,similarity0.569362,captionEnglish Garden Party Hats S/8,urlhttps://cdn.shopify.com/s/files/1/2642/1956/products/Screen_Shot_2020-02-11_at_4.52.48_PM_110x110@2x.png?v=1581461778,id2177895225,similarity0.569318
In[]:=
Import[#["url"]]&/@Take[%,4]
Out[]=
$Aborted
In[]:=
URLRead[#["url"],TimeConstraint->2]&/@Take[%226,4]
Out[]=
HTTPResponse,HTTPResponse,Failure,HTTPResponse
In[]:=
Import/@DeleteCases[%,_Failure]
Out[]=
,
,
Image Distances
Image Distances
In[]:=
imageEncoder=NetModel[{"CLIP Multi-domain Feature Extractor","InputDomain"->"Image","Architecture"->"ViT-L/14"}];
In[]:=
URLExecuteHTTPRequest"https://knn.laion.ai/knn-service",Method->"POST","Body"ExportString<|"indice_name"->"laion5B-L-14",(*"text""cat",*)"embedding_input"->NormalizeimageEncoder
,"deduplicate"->True,"use_violence_detector"->True,"use_safety_model"->True,"use_mclip"->False,"aesthetic_score"->9,"aesthetic_weight"->.5,"modality"->"image","num_images"->40,"num_result_ids"->40|>,"JSON","RawJSON"
Canonical Cat
Canonical Cat
Definition
Definition
Note: aesthetic score removed....
Note: aesthetic score removed....
Blurring an image
Blurring an image