[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7044":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":16,"starSnapshotCount":16,"syncStatus":39,"lastSyncTime":40,"discoverSource":41},7044,"Queryable","mazzzystar\u002FQueryable","mazzzystar","Run OpenAI's CLIP and Apple's MobileCLIP model on iOS to search photos.","https:\u002F\u002Fapps.apple.com\u002Fapp\u002Fid1661598353",null,"Swift",2948,448,11,14,0,1,13,29.96,"MIT License",false,"main",[24,25,26,27,28,29,30,31,32,33,34,35],"clip-model","ios","macos","mobile","mobile-clip","mobileclip","natural-language-image-search","openai-clip","photos","search","semantic-search","swiftui","2026-06-12 02:01:33","# Queryable\n\n\u003Ca href=\"https:\u002F\u002Fapps.apple.com\u002Fus\u002Fapp\u002Fqueryable-find-photo-by-text\u002Fid1661598353?platform=iphone\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub-production-user-asset-6210df.s3.amazonaws.com\u002F6824141\u002F252914927-51414112-236b-4f7a-a13b-5210f9203198.svg\" alt=\"download-on-the-app-store\">\n\u003C\u002Fa>\n\n[![Queryable](https:\u002F\u002Fmazzzystar.com\u002Fimages\u002F2022-12-28\u002FQueryable-search-result.jpg)](https:\u002F\u002Fapps.apple.com\u002Fus\u002Fapp\u002Fqueryable-find-photo-by-text\u002Fid1661598353?platform=iphone)\n\nThe open-source code of Queryable, an iOS app, leverages the ~~OpenAI's [CLIP](https:\u002F\u002Fgithub.com\u002Fopenai\u002FCLIP)~~ Apple's [MobileCLIP](https:\u002F\u002Fgithub.com\u002Fapple\u002Fml-mobileclip) model to conduct offline searches in the 'Photos' album. Unlike the category-based search model built into the iOS Photos app, Queryable allows you to use natural language statements, such as `a brown dog sitting on a bench`, to search your album. Since it's offline, your album privacy won't be compromised by any company, including Apple or Google.\n\n[Blog](https:\u002F\u002Fmazzzystar.com\u002F2022\u002F12\u002F29\u002FRun-CLIP-on-iPhone-to-Search-Photos\u002F) | [App Store](https:\u002F\u002Fapps.apple.com\u002Fus\u002Fapp\u002Fqueryable-find-photo-by-text\u002Fid1661598353?platform=iphone) | [Website](https:\u002F\u002Fqueryable.app\u002F) | [Story](https:\u002F\u002Fmazzzystar.com\u002F2024\u002F07\u002F21\u002FTwo-Years-of-an-AI-Photo-Album-Search-App\u002F) | [故事](https:\u002F\u002Fmazzzystar.com\u002F2024\u002F07\u002F21\u002FTwo-Years-of-an-AI-Photo-Album-Search-App-zh\u002F)\n\n## How does it work?\n\n- Encode all album photos using the CLIP Image Encoder, compute image vectors, and save them.\n- For each new text query, compute the corresponding text vector using the Text Encoder.\n- Compare the similarity between this text vector and each image vector.\n- Rank and return the top K most similar results.\n\nThe process is as follows:\n\n![](https:\u002F\u002Fraw.githubusercontent.com\u002Fmazzzystar\u002FQueryable\u002Fce184131123650fb014eaa8514e37b1202625d14\u002FQueryable\u002FQueryable\u002FAssets.xcassets\u002FQueryable-flow-chart.jpeg)\n\nFor more details, please refer to my blog: [Run CLIP on iPhone to Search Photos](https:\u002F\u002Fmazzzystar.com\u002F2022\u002F12\u002F29\u002FRun-CLIP-on-iPhone-to-Search-Photos\u002F).\n\n# Updates\n\n[2024-09-01]: Now supports Apple's [MobileCLIP](https:\u002F\u002Fgithub.com\u002Fapple\u002Fml-mobileclip).\n\nYou can download the exported `TextEncoder_mobileCLIP_s2.mlmodelc` and `ImageEncoder_mobileCLIP_s2.mlmodelc` from [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F12ze3UcqrXt9qeySGh_j_zWE-PWRDTzJv?usp=drive_link). Currently we use `s2` model as the default model, which balances both efficiency & precision.\n\n## [PicQuery](https:\u002F\u002Fgithub.com\u002Fgreyovo\u002FPicQuery)(Android)\n\n\u003Ca href=\"https:\u002F\u002Fplay.google.com\u002Fstore\u002Fapps\u002Fdetails?id=me.grey.picquery\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub-production-user-asset-6210df.s3.amazonaws.com\u002F6824141\u002F274861421-69a37ae7-55b3-46b2-ad24-5368eb2734f9.png\" alt=\"download-on-the-app-store\" width=\"120\">\n\u003C\u002Fa>\n\nThe Android version([Code](https:\u002F\u002Fgithub.com\u002Fgreyovo\u002FPicQuery)) developed by [@greyovo](https:\u002F\u002Fgithub.com\u002Fgreyovo), which supports both English and Chinese. See details in [#12](https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F12).\n\n## Run on Xcode\n\nDownload the `TextEncoder_mobileCLIP_s2.mlmodelc` and `ImageEncoder_mobileCLIP_s2.mlmodelc` from [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F12ze3UcqrXt9qeySGh_j_zWE-PWRDTzJv?usp=drive_link).\nClone this repo, put the downloaded models below `CoreMLModels\u002F` path and run Xcode, it should work.\n\n## Core ML Export\n\n> If you only want to run Queryable, you can **skip this step** and directly use the exported model from [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F12ze3UcqrXt9qeySGh_j_zWE-PWRDTzJv?usp=drive_link). If you wish to implement Queryable that supports your own native language, or do some model quantization\u002Facceleration work, here are some guidelines.\n\nThe trick is to separate the `TextEncoder` and `ImageEncoder` at the architecture level, and then load the model weights individually. Queryable uses the ~~OpenAI [ViT-B\u002F32](https:\u002F\u002Fgithub.com\u002Fopenai\u002FCLIP)~~ Apple's [MobileCLIP](https:\u002F\u002Fgithub.com\u002Fapple\u002Fml-mobileclip) model, and I wrote a [Jupyter notebook](https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fblob\u002Fmain\u002FPyTorch2CoreML.ipynb) to demonstrate how to separate, load, and export the OpenAI's CLIP Core ML model(If you want the MobileCLIP's export script, checkout [#issuecomment-2328024269](https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F45#issuecomment-2328024269)). The export results of the ImageEncoder's Core ML have a certain level of precision error, and more appropriate normalization parameters may be needed.\n\n- Update (2024\u002F09\u002F01): The default model is now Apple's [MobileCLIP](https:\u002F\u002Fgithub.com\u002Fapple\u002Fml-mobileclip). Exported Model: [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F12ze3UcqrXt9qeySGh_j_zWE-PWRDTzJv?usp=drive_link)\n- Update (2023\u002F09\u002F22): Thanks to [jxiong22](https:\u002F\u002Fgithub.com\u002Fjxiong22) for providing the [scripts](https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fblob\u002Fmain\u002FPyTorch2CoreML-HuggingFace.ipynb) to convert the HuggingFace version of `clip-vit-base-patch32`. This has significantly reduced the precision error in the image encoder. For more details, see [#18](https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fpull\u002F18).\n\n## Contributions\n\n> Disclaimer: I am not a professional iOS engineer, please forgive my poor Swift code. You may focus only on the loading, computation, storage, and sorting of the model.\n\nYou can apply Queryable to your own product, but I don't recommend simply modifying the appearance and listing it on the App Store.\nIf you are interested in optimizing certain aspects(such as https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F4, ~~https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F5~~, https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F6, https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F10, https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F11, ~~https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F12~~), feel free to submit a PR (Pull Request).\n\n- Thanks to [\n  Chris Buguet](https:\u002F\u002Fgithub.com\u002Fcodingstyle), the issue (https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F5) where devices below iPhone 11 couldn't run has been fixed.\n- [greyovo](https:\u002F\u002Fgithub.com\u002Fgreyovo) has completed the Android app(https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F12) development: [Google Play](https:\u002F\u002Fplay.google.com\u002Fstore\u002Fapps\u002Fdetails?id=me.grey.picquery). The author stated that the code will be released in the future.\n- [yujinqiu](https:\u002F\u002Fgithub.com\u002Fyujinqiu) has developed the macOS version named [Searchable](https:\u002F\u002Fwww.engineerdraft.com\u002Fen\u002Fsearchable\u002F)(not open-sourced), which supports full-disk search. See [#4](https:\u002F\u002Fgithub.com\u002Fmazzzystar\u002FQueryable\u002Fissues\u002F4#issuecomment-1990979537)\n\nThank you for your contribution : )\n\nIf you have any questions\u002Fsuggestions, here are some contact methods: [Discord](https:\u002F\u002Fdiscord.com\u002Finvite\u002FR3wNsqq3v5) | [Twitter](https:\u002F\u002Ftwitter.com\u002Fimmazzystar) | [Reddit: r\u002FQueryable](https:\u002F\u002Fwww.reddit.com\u002Fr\u002FQueryable\u002F).\n\n## License\n\nMIT License\n\nCopyright (c) 2023 Ke Fang\n","Queryable 是一个 iOS 应用，利用 Apple 的 MobileCLIP 模型实现基于自然语言的照片搜索。其核心功能是通过离线方式对照片进行编码，并使用文本查询来匹配最相似的照片，从而保护用户隐私。技术上，它采用 CLIP 图像编码器和文本编码器生成向量，并计算相似度以返回结果。适合需要在本地相册中快速查找特定照片的场景，尤其适用于那些希望避免数据上传至云端的用户。",2,"2026-06-11 03:10:15","top_language"]