mazzzystar / queryable Goto Github PK
View Code? Open in Web Editor NEWRun OpenAI's CLIP model on iOS to search photos.
Home Page: https://queryable.app
License: MIT License
Run OpenAI's CLIP model on iOS to search photos.
Home Page: https://queryable.app
License: MIT License
目前已有一个win10版,https://github.com/EdVince/CLIP-ImageSearch-NCNN 但非常难用,作者没做持久化处理,也就是说关掉了就要重新扫描一遍图库,而且搜索结果只能出来一张图片,更接近demo
哪位大佬能开发一个支持中文的win10版
Currently, Queryable does not support devices below the iPhone 11 (with the A13 chip). On these devices, indexing can be built normally, but the search results for any query are the same, and I haven't debugged the problem. If you find a solution, I would greatly appreciate it if you could submit a PR.
It would be amazing if this all added iMessage support. Then it would be possible to use Queryable to find and insert photos directly within iMessage
Currently only the compiled CoreML models (.mlmodelc
files) are provided in the Google Drive. Providing the .mlmodel
or even better the .mlpackage
files would be great since this would allow tweaking the network and playing with quantification options.
Because the CLIP model is language-dependent, if we use something like Multilingual-CLIP (supporting 40+ languages), the size of the Queryable app would exceed 1GB. And because of offline limitations, it's impossible to use a translation API, which is why Queryable currently only supports English.
I have added a script to export PyTorch models to Core ML. Therefore, if you're interested, you can train a CLIP model in your own language and integrate it into Queryable. New model additions are welcome : )
I checked out class PhotoSearcherModel
and class PhotoSearcher
, and found that when calculating similarity, you end up using spherical_dist_loss
, which contradicts the introduction of "Calculating cosine similarity" in the README diagram. I am a little confused and wonder if you could give some insight about that. :)
Thanks in advance.
In iOS 17 beta 3, regardless of the keyword used, the search results are always the same.
Why not first filter the images with LSH, and then perform cosine calculations with vectors?
This project is amazing.I have an idea, what if we reverse the process and perform image-to-text analysis on a single image?For example:
a dog sitting next to a car
like this model: https://huggingface.co/nlpconnect/vit-gpt2-image-captioning
would that be feasible? I don't have much experience with large models and would like to ask for some design advice. Thank you :>
Is this function actually correct?
func cosine_similarity(A: MLShapedArray<Float32>, B: MLShapedArray<Float32>) -> Float {
let magnitude = vDSP.rootMeanSquare(A.scalars) * vDSP.rootMeanSquare(B.scalars)
let dotarray = vDSP.dot(A.scalars, B.scalars)
return dotarray / magnitude
}
This line does not seem to be calculating the magnitude of a vector which is supposed to the square root of the sum of squares (RSS) but is actually calculating the RMS (the square root of the mean sum of squares):
let magnitude = vDSP.rootMeanSquare(A.scalars) * vDSP.rootMeanSquare(B.scalars)
My suggested correction would be:
let magnitude = vDSP.sumOfSquares(A.scalars).squareRoot() * vDSP.sumOfSquares(B.scalars).squareRoot()
I am not good at this stuff but trying t figure it out.
I've adapted parts of this app to test CLIP on Mac and iOS devices, and when I evaluate the similarities of various texts to a given image, the values don't seem right. For example, given n texts, the softmax of the spherical distances or cosine similarities results in values that are all close to 1/n, even when one text should be a clear match for the image and another should not be.
Perhaps something in my adaptation is causing this error, but I wanted to ask if you've encountered this issue before.
The current version only creates an index during the first import. It does not update the index database when album pictures are updated, and only does so after uninstalling and reinstalling. It is necessary to add a feature for manual or automatic indexing
Hello,
I encountered a failure when exporting with coremltools:
Converting PyTorch Frontend ==> MIL Ops: 6%|▎ | 63/1131 [00:00<00:00, 10698.02 ops/s]
...
RuntimeError: PyTorch convert function for op 'unflatten' not implemented.
which versions of PyTorch and coremltools you are using?
My development environment:
m1 mac pro
python: 3.8.17
torch: 2.0.0
coremltools: 6.3.0
Thanks~
There's a feature request I hope can be considered:
Currently, we can quickly search for the desired photo,
but this photo is sequential in the album.
I hope we can quickly locate this photo within the album,
or alternatively, directly display the consecutive photos in this app's interface.
It seems impossible to select the original image when sharing photos on iOS, so I usually find the picture in the photo app, mark it as a favorite, and then send the picture from WeChat through the favorite album. I hope to add this feature
(这里是实际操作的视频)https://github.com/user-attachments/assets/d33b2d27-922c-4788-9cd1-86246661a45e
希望这个小问题能尽快修复,谢谢啦
Hi there,
I'm try to print the top N similarity with the following output, sim is less than 0.5, but the result for human is right.
I'm not sure weather it's a bug or not.
photoID: E223B067-975A-49AF-AC42-6387EFC2C73D/L0/001, sim: 0.260636
photoID: E41F3701-3434-44E8-B40C-F7708C43EBA0/L0/001, sim: 0.257243
photoID: C0BD9F08-99D0-42E6-A1FA-275B6FCA4141/L0/001, sim: 0.256340
photoID: 287F7C32-D2B3-43D9-AB2C-A24E26CA4CD4/L0/001, sim: 0.251475
photoID: EDBFBAF6-4503-48FA-97DF-848A1F74C30A/L0/001, sim: 0.251110
photoID: AC47FDB3-4C68-4142-B0B5-40631EE0D41A/L0/001, sim: 0.249579
photoID: EB8D302D-C742-43E6-9ED0-156D669F1814/L0/001, sim: 0.249101
photoID: AF3ABD8F-4A75-4178-95C4-A7D218123BFF/L0/001, sim: 0.248550
photoID: 3412635C-AD4C-49FB-82BF-05552F964DAF/L0/001, sim: 0.247968
photoID: 78DBA56B-B2E1-4125-B746-66EF3319CC89/L0/001, sim: 0.247247
https://drive.google.com/drive/folders/12ze3UcqrXt9qeySGh_j_zWE-PWRDTzJv?usp=drive_link&pli=1
i want to download the model of queryable, but the google drive can not access
We've received a lot of user feedback, among which the most frequently raised issues are:
Perhaps someone is interested in the implementation of these features : )
Thanks for making the app!
I'd like to get the CLIP embeddings for all my photos in iCloud, and it would be really convenient if the app supports exporting calculated embeddings and would save me a lot of time and compute, and it will allow users to explore their photos' semantics in alternative ways.
Would you consider adding this feature?
24000 images, memory leak caused crashes during construction.
The "prediction" method of MLModel leads to a continuous increase in memory.
Many photos are stored in the Synology NAS, but when there are too many, it becomes hard to find specific ones. I hope there can be a solution for this. Thank you
This is a feature that I couldn't implement during the closed-source period. Currently, the Mac OS version only supports querying photos from the album. I hope to expand this to search for images across the entire disk.
As for Windows user, it should be entirely another app that could runs on Win system.
PR submissions are welcome.
Once Queryable returns search results can I somehow identify the exact photo on my device that it found? For example I’d like to go to the original photo and annotate it
Are there any plans to support Android devices in the future?
In great need.q(≧▽≦q)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.