Skip to content

refactored the module loading and dependency handling#7

Open
KevinAJohnson96 wants to merge 1 commit intoshhossain:mainfrom
KevinAJohnson96:Kevins_Branch
Open

refactored the module loading and dependency handling#7
KevinAJohnson96 wants to merge 1 commit intoshhossain:mainfrom
KevinAJohnson96:Kevins_Branch

Conversation

@KevinAJohnson96
Copy link
Copy Markdown

The current implementation uses conditional imports within functions controlled by global
variables and locks. This setup may lead to race conditions or other threading issues as threads
may not have real-time knowledge about the imports done by other threads, potentially causing
the same module to be imported multiple times. I improved the FaceDB project by refactoring the module loading and dependency handling to enhance thread safety. I modified the db.py file to handle the deepface and face_recognition imports at the top level and established thread safe checks for their availability.

Copy link
Copy Markdown
Owner

@shhossain shhossain left a comment

Choose a reason for hiding this comment

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

But if user has both deepface and face_recognation available. Both will be imported.

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.

2 participants