Skip to content

Run Apple's Mobile-Clip model on iOS to search photos.

License

Notifications You must be signed in to change notification settings

Norod/Queryable-mobileclip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queryable-MC [ML-MobileClip fork]

This is a fork of Queryable, an iOS app, which leverages the Apple's ml-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.

How does it work?

  • Encode all album photos using the ml-mobileclip Image Encoder, compute image vectors, and save them.
  • For each new text query, compute the corresponding text vector using the Text Encoder.
  • Compare the similarity between this text vector and each image vector.
  • Rank and return the top K most similar results.

Run on Xcode

You need to put the precompiled .mlpackage files (folder packages) under the folder Queryable/Queryable/put_models_here

To get them, go to a folder where you put your projects and do

git clone https://huggingface.co/Norod78/CoreML-MobileCLIP-S0

Then copy ImageEncoder_mobileclip_s0.mlpackage and TextEncoder_mobileclip_s0.mlpackage from the folder CoreML-MobileCLIP-S0 to Queryable/Queryable/put_models_here

Core ML Export

If you wish to export from pytorch yourself (e.g do some model quantization/acceleration work), here is A reference notbook I've prepared for converting Apple's S0 weights to CoreML

Original Queryable License

MIT License

Copyright (c) 2023 Ke Fang

ML-MobileClip Port

By Doron Adler

About

Run Apple's Mobile-Clip model on iOS to search photos.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 88.1%
  • Jupyter Notebook 11.9%