Open nauyeskhan-monosoft opened 1 week ago
Thanks for your feedback. Theoretically, if you specify db_path, it should be stored. If not, there may be some problems, I will test the latest version later and give you feedback.
Hello!
@tunmx, any updates?
Sorry, I haven't updated it yet, maybe it needs to be on the weekend.
Hi, I've fixed this issue and added Python test cases. It occurred in the Python native interface, so you just need to pull the code - no need to recompile the dynamic library. #112
import os
import cv2
import inspireface as ifac
from inspireface.param import *
import numpy as np
import os
def case_feature_hub():
db_path = "test.db"
if os.path.exists(db_path):
os.remove(db_path)
# Configure the feature management system.
feature_hub_config = ifac.FeatureHubConfiguration(
feature_block_num=10,
enable_use_db=True,
db_path=db_path,
search_threshold=0.48,
search_mode=HF_SEARCH_MODE_EAGER,
)
ret = ifac.feature_hub_enable(feature_hub_config)
assert ret, "Failed to enable FeatureHub."
print(ifac.feature_hub_get_face_count())
for i in range(10):
feature = ifac.FaceIdentity(np.random.rand(512), i, "test")
ifac.feature_hub_face_insert(feature)
print(ifac.feature_hub_get_face_count())
assert os.path.exists(db_path), "FeatureHub database file not found."
if __name__ == "__main__":
case_feature_hub()
I am using InspireFace’s FeatureHub in Python to handle face recognition features, and I would like to save the extracted features for millions of images in a persistent database file. My goal is to avoid reprocessing and reinserting each feature on every run.
Currently, I’ve configured FeatureHub as follows:
Despite setting
enable_use_db=True
and specifyingdb_path
, I don’t see any database file saved at the specified location. Is there an option or additional method to save the FeatureHub to disk, so that it can be loaded directly in a new session without re-insertion? If so, could you provide guidance on how to do this in Python?