Repository navigation
Conversation
serengil
approved these changes
Nov 16, 2026
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.
Tickets
N/A
What has been done
Milvus
insertaccepts an existing primary key as another entity. Registering the same faces repeatedly therefore adds duplicate entities despite their stable content-derived IDs. Repeating two faces four times leaves eight entities in the native database.Keep the last record for each ID within a batch and use
upsertfor the write. Re-registering a face then replaces its existing entity and image name. The returned count continues to count the supplied embeddings, including updates.How to test
pip install pymilvus==2.6.9 milvus-lite==2.5.1 'setuptools<81' DEEPFACE_BACKEND_ENGINE=onnx python -m pytest -q \ tests/integration/test_milvus_registration_lite.py \ tests/unit/test_milvus_stable_ids.py \ tests/unit/test_milvus_distance.py \ tests/unit/test_milvus_complete_gallery.py \ tests/integration/test_milvus_distance_lite.py \ tests/integration/test_milvus_complete_gallery_lite.pyPython 3.10 and 3.12 validation, using real PyMilvus 2.6.9 and Milvus Lite 2.5.1:
The database tests use synthetic face arrays and embeddings; no recognition model weights are needed. Milvus documents the insert/upsert distinction here.