Skip to content

[#Feature] develop database, add uuid & name in tables#323

Open
mahdizynali wants to merge 13 commits intoHyperInspire:masterfrom
mahdizynali:master
Open

[#Feature] develop database, add uuid & name in tables#323
mahdizynali wants to merge 13 commits intoHyperInspire:masterfrom
mahdizynali:master

Conversation

@mahdizynali
Copy link

@mahdizynali mahdizynali commented Nov 5, 2025

.:: Feature Introduction ::.

in this update database was developed more in order to contain name & uuid for each embedding face or may target.
for each inserting request you must pass a name as generating in database so automatically a unique hash will create by InsertVector function and reach The database. fore example :

Embedded embedding;
std::string Name = "test"
int64_t id_ret = -1;
std::string uuid = "cabfe9b7-0413-431d-8f93-aa3dd30124da";
INSPIREFACE_FEATURE_HUB->FaceFeatureInsert(embedding, INSPIRE_INVALID_ID, id_ret, Name, uuid);

if you put uuid section ans empty string, it will automatically generate uuid before inserting
when try to ViewDBTable :

INSPIREFACE_FEATURE_HUB->ViewDBTable();

result : 

=== Table Content ===
ID | tname | uuid | Vector (first 5 elements)
-----------------------------------------------------------
1 | maze | c23a2062-891d-4567-8645-93206903d909 | 0.063791, -0.017193, -0.064175, -0.002511, -0.024071...
2 | mahdi | e980930c-671e-4544-b5c4-b6393cac8e45 | 0.074956, -0.007352, -0.025373, 0.034843, -0.004808...
3 | gates | ec4b088a-8311-4241-b8f8-9d1999215dd9 | -0.019994, 0.030670, -0.064556, -0.012860, -0.047974...
4 | bezos | d2417e28-e341-4c98-8c37-c522cc7140f9 | 0.035502, -0.009702, -0.057357, 0.009781, -0.008556...
5 | zuckerberg | c308121a-1883-4189-8524-4828dc70def9 | -0.002558, 0.063818, 0.053428, -0.051147, -0.032162...

Also i have develop some functions like GetAllTargetsNames which would return a vector pair of names & uuid :

std::vector<std::pair<std::string, std::string>> names = INSPIREFACE_FEATURE_HUB->GetAllTargetsNames();

result : 

Targets count in DB: 5
  - maze | c23a2062-891d-4567-8645-93206903d909
  - mahdi | e980930c-671e-4544-b5c4-b6393cac8e45
  - gates | ec4b088a-8311-4241-b8f8-9d1999215dd9
  - bezos | d2417e28-e341-4c98-8c37-c522cc7140f9
  - zuckerberg | c308121a-1883-4189-8524-4828dc70def9

this update makes database management more robust and handle better intraction with front and back of AI modules

Copy link

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary:

This PR adds UUID and name (tname) fields to the face feature database tables to enhance identity management. Each face embedding now gets a unique UUID and associated name, enabling better tracking and identification. The changes include:

  • Modified database schema to include tname and uuid columns
  • Added GenerateUUID() function for unique identifier generation
  • Updated insertion APIs to require name parameters
  • Added GetAllTargetsNames() to retrieve name/UUID pairs
  • Updated search results to include target names

Review Summary:

Identified 6 critical issues requiring attention before merge. The main concerns are: (1) missing distance_metric parameter in table schema affecting similarity calculations, (2) thread-safety issue in UUID generation, (3) logic bug in GetAllTNames returning duplicates instead of unique names, (4) hardcoded "Target" name in C API breaking the new feature for C API users, (5) missing transaction rollback on batch insert failures violating database safety patterns, and (6) missing validation that vectors are normalized before storage.

Review performed using knowledge base standards for database transaction safety, API compatibility, and thread safety patterns.

Follow-up suggestions:

  • @devloai fix the identified critical issues (distance_metric, C API hardcoded name, transaction rollback)
  • @devloai add vector normalization validation or enforcement in InsertVector

@devloai
Copy link

devloai bot commented Nov 5, 2025

Unable to address comment. You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

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

Successfully merging this pull request may close these issues.

1 participant