Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum Number of Images? #47

Open
antgiant opened this issue Sep 8, 2024 · 4 comments
Open

Maximum Number of Images? #47

antgiant opened this issue Sep 8, 2024 · 4 comments

Comments

@antgiant
Copy link

antgiant commented Sep 8, 2024

I have been making heavy use of Queryable and really enjoying it. However, it recently seems to have hit some internal limit on the total number of images it supports. When I update the index it shows progress up to 4,900/total then crashes like it normally does due to the memory leak (usually the memory leak crash is at 10,000-20,000). However, when I restart the app the total number to index is unchanged.

I tried deleting and reinstalling the app in case my index got somehow corrupted. A bit over 200,000 images into my 300,000 image library the same thing started happening again. I thought it was notable that the images being indexed were different for the crash before the reinstall and after. Also, before the reinstall it had indexed about 50,000 more before getting stuck at the 4,900 index crash.

Also, as my library has gotten bigger performance has gotten quite a bit worse. It is currently taking about 70 seconds to launch the app, have the model load and successfully complete the first search. Subsequent searches take about 45 seconds each to complete once I hit search. (I am using an iPhone 14 Pro Max).
I assume this is due to my picture library size but if speed up is possible I would really appreciate it.

@antgiant
Copy link
Author

antgiant commented Sep 8, 2024

Hmm actually I just noticed that the 4,900 index crash started right around when the app was updated to Apple's CLIP model. Perhaps they are related?

@mazzzystar
Copy link
Owner

It works fine on my iPhone 15, and I only experienced a crash after 20k images. The load and search speed is a significant improvement over MobileCLIP (2x faster).

As for the crash, there are usually two reasons:

  • Insufficient free memory. This happens when you have a large number of photos (say 20k), and then you get stuck. You can try closing some memory-consuming apps (e.g., Telegram, WeChat, Chrome) and rebuilding the index again. This should allow you to continue, as it saves a checkpoint every 5k embeddings when building the index.
  • An image with unusual dimensions. When the height-to-width ratio is highly abnormal (say 19200 x 40), it could cause a resize issue.

@antgiant
Copy link
Author

antgiant commented Sep 8, 2024

Hmm that doesn't appear to be the case for me. What can I provide to help get this debugged?

Actually, it seems to be crashing on the checkpoint save. That would explain why it is getting stuck at 4,900 and then crashing. Also, I have noticed that the final picture has been changing as I add more photos to my library. So I am pretty confident it is not an aspect ratio issue. Additionally, I killed all other apps and the behavior is unchanged.

Oh and is the Apple CLIP version in the App Store yet? If not than I don't have that version.

@antgiant
Copy link
Author

antgiant commented Sep 9, 2024

A few additional notes on this.

  • I am running iOS 18 developer beta if that matters
  • I just tried again and it successfully cleared the stuck point after a noticeably long delay at 4,900. That delay repeated at 9,900 and then again at 14,900 but then it crashed during the delay at 14,900. I ran it again and once again it crashed after a delay at 4,900
  • So far the crash has always happened in a large collection of nearly identical photos. As in the source images for a Timelapse. So hundreds or thousands of photos that are all very similar with only minor differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants