Repository navigation
feat: MobileCLIP-S0 INT8 ONNX visual search + CLIP BPE tokenizer - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MobileClipOnnxEncoder,ClipBpeTokenizer): Enables true zero-shot visual item & concept search alongside OCR text search in a shared 512-d embedding space usingonnxruntime-android:1.25.0(verified 0 platform permissions and 16 KiBPT_LOAD 0x4000on bothlibonnxruntime.soandlibonnxruntime4j_jni.so).scripts/fetch-mobileclip-onnx.sh): Fetchesmobileclip_s0_vision_int8.onnx(11 MB),mobileclip_s0_text_int8.onnx(41 MB), andmobileclip_s0_tokenizer.json(2.1 MB) into Play Asset Delivery:models_packat build time with zero binary blobs checked into git.ClipBpeTokenizer): Exact CLIP BPE vocab + merges +[BOS=49406, ..., EOS=49407, PAD=0]length-77 encoding.MobileClipOnnxEncoder.ensureInitialized()race so concurrent queries wait cleanly for ORT session initialization.searchJob?.cancel()+ query freshness guard inRecallViewModel.refreshSearch().max(0.08, 0.72 * topSem)) inRecallDatabase.search()and bumpedDB_VERSION = 4for clean automatic re-indexing..github/workflows/ci.yml): Asserts all 5 model/tokenizer artifacts are packaged in both:models_packAAB and debug APK alongside zero-permission, 16 KiB ELF/zipalign, and clean-room audits.Verification
./gradlew --no-daemon testDebugUnitTest assembleDebug bundleDebug— 16/16 unit & Robolectric tests PASS../scripts/check-zero-permissions.sh— 0<uses-permission>in source manifest, 0 platform permissions in merged manifests & APK../scripts/check-16k-alignment.sh— all 4 native libs (libfreesched.so,libonnxruntime.so,libonnxruntime4j_jni.so,libandroidx.graphics.path.so)ZIP_STORED,PT_LOAD 0x4000,zipalign -P 16PASS../scripts/clean-room-audit.sh— PASS across 55 files (0 errors).