{"id":2762,"date":"2024-06-28T13:09:07","date_gmt":"2024-06-28T13:09:07","guid":{"rendered":"https:\/\/fadyanwar.com\/?p=2762"},"modified":"2024-06-28T13:28:02","modified_gmt":"2024-06-28T13:28:02","slug":"offline-ai-image-search","status":"publish","type":"post","link":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/","title":{"rendered":"Offline AI Image Search"},"content":{"rendered":"\n<p>So using <a href=\"https:\/\/huggingface.co\/Salesforce\/blip-image-captioning-large\">one of Hugging Face AI models<\/a>, I mentioned before, I wrote a simple Python script to iterate images in a folder, caption the images then <a href=\"https:\/\/pypi.org\/project\/piexif\/\">update their metadata<\/a> with said captions, making it possible to search my <a href=\"https:\/\/syncthing.net\/\">Syncthing <\/a>local storage with content description of images as shown in the screen capture. I left it running over night and this was the result. Considering that I left it running locally on a <a href=\"https:\/\/www.raspberrypi.org\/\">Raspi<\/a> without relying on any online service, the result is quite impressive. By the way, can anyone recognize this guy?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"229\" src=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Image-Caption-Screenshot-2024-06-28-123027.png?resize=723%2C229&#038;ssl=1\" alt=\"\" class=\"wp-image-2764\" srcset=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Image-Caption-Screenshot-2024-06-28-123027.png?w=723&amp;ssl=1 723w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Image-Caption-Screenshot-2024-06-28-123027.png?resize=300%2C95&amp;ssl=1 300w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Image-Caption-Screenshot-2024-06-28-123027.png?resize=500%2C158&amp;ssl=1 500w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"603\" height=\"381\" src=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?resize=603%2C381&#038;ssl=1\" alt=\"\" class=\"wp-image-2763\" srcset=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?w=603&amp;ssl=1 603w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?resize=300%2C190&amp;ssl=1 300w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?resize=500%2C316&amp;ssl=1 500w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>So using one of Hugging Face AI models, I mentioned before, I wrote a simple Python script to iterate images in a folder, caption the images then update their metadata with said captions, making it possible to search my Syncthing local storage with content description of images as shown in the screen capture. I left [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2763,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_vp_format_video_url":"","_vp_image_focal_point":[],"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[2,21,30,9],"class_list":["post-2762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-ai","tag-linux","tag-opensource","tag-raspberrypi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Offline AI Image Search - Fady Anwar<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Offline AI Image Search - Fady Anwar\" \/>\n<meta property=\"og:description\" content=\"So using one of Hugging Face AI models, I mentioned before, I wrote a simple Python script to iterate images in a folder, caption the images then update their metadata with said captions, making it possible to search my Syncthing local storage with content description of images as shown in the screen capture. I left [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/\" \/>\n<meta property=\"og:site_name\" content=\"Fady Anwar\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-28T13:09:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-28T13:28:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png\" \/>\n\t<meta property=\"og:image:width\" content=\"603\" \/>\n\t<meta property=\"og:image:height\" content=\"381\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Fady Anwar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fadyanwar\" \/>\n<meta name=\"twitter:site\" content=\"@fadyanwar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fady Anwar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/\"},\"author\":{\"name\":\"Fady Anwar\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"headline\":\"Offline AI Image Search\",\"datePublished\":\"2024-06-28T13:09:07+00:00\",\"dateModified\":\"2024-06-28T13:28:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/\"},\"wordCount\":97,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"image\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1\",\"keywords\":[\"AI\",\"Linux\",\"opensource\",\"raspberrypi\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/\",\"url\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/\",\"name\":\"Offline AI Image Search - Fady Anwar\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1\",\"datePublished\":\"2024-06-28T13:09:07+00:00\",\"dateModified\":\"2024-06-28T13:28:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1\",\"width\":603,\"height\":381},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2024\\\/06\\\/28\\\/offline-ai-image-search\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fadyanwar.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Offline AI Image Search\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#website\",\"url\":\"https:\\\/\\\/fadyanwar.com\\\/\",\"name\":\"Fady Anwar\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fadyanwar.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\",\"name\":\"Fady Anwar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"caption\":\"Fady Anwar\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Offline AI Image Search - Fady Anwar","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/","og_locale":"en_US","og_type":"article","og_title":"Offline AI Image Search - Fady Anwar","og_description":"So using one of Hugging Face AI models, I mentioned before, I wrote a simple Python script to iterate images in a folder, caption the images then update their metadata with said captions, making it possible to search my Syncthing local storage with content description of images as shown in the screen capture. I left [&hellip;]","og_url":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/","og_site_name":"Fady Anwar","article_published_time":"2024-06-28T13:09:07+00:00","article_modified_time":"2024-06-28T13:28:02+00:00","og_image":[{"width":603,"height":381,"url":"https:\/\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png","type":"image\/png"}],"author":"Fady Anwar","twitter_card":"summary_large_image","twitter_creator":"@fadyanwar","twitter_site":"@fadyanwar","twitter_misc":{"Written by":"Fady Anwar","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#article","isPartOf":{"@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/"},"author":{"name":"Fady Anwar","@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"headline":"Offline AI Image Search","datePublished":"2024-06-28T13:09:07+00:00","dateModified":"2024-06-28T13:28:02+00:00","mainEntityOfPage":{"@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/"},"wordCount":97,"commentCount":3,"publisher":{"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"image":{"@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1","keywords":["AI","Linux","opensource","raspberrypi"],"articleSection":["Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/","url":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/","name":"Offline AI Image Search - Fady Anwar","isPartOf":{"@id":"https:\/\/fadyanwar.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#primaryimage"},"image":{"@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1","datePublished":"2024-06-28T13:09:07+00:00","dateModified":"2024-06-28T13:28:02+00:00","breadcrumb":{"@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#primaryimage","url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1","contentUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1","width":603,"height":381},{"@type":"BreadcrumbList","@id":"https:\/\/fadyanwar.com\/index.php\/2024\/06\/28\/offline-ai-image-search\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fadyanwar.com\/"},{"@type":"ListItem","position":2,"name":"Offline AI Image Search"}]},{"@type":"WebSite","@id":"https:\/\/fadyanwar.com\/#website","url":"https:\/\/fadyanwar.com\/","name":"Fady Anwar","description":"","publisher":{"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fadyanwar.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03","name":"Fady Anwar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","caption":"Fady Anwar"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g"}}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2024\/06\/Cheaster-Betty-Screenshot-2024-06-28-122900.png?fit=603%2C381&ssl=1","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/2762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/comments?post=2762"}],"version-history":[{"count":5,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/2762\/revisions"}],"predecessor-version":[{"id":2972,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/2762\/revisions\/2972"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/media\/2763"}],"wp:attachment":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/media?parent=2762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/categories?post=2762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/tags?post=2762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}