Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulties to make the InspireFace Python test code to work #2596

Open
mario-mlc opened this issue Jun 18, 2024 · 2 comments
Open

Difficulties to make the InspireFace Python test code to work #2596

mario-mlc opened this issue Jun 18, 2024 · 2 comments

Comments

@mario-mlc
Copy link

mario-mlc commented Jun 18, 2024

Hello InspireFace Team and thank you for creating apparently an easier and better API for Face Recognition, Detection, Tracking etc.

I tried to test InspireFace on an x64 architecture (PC running Linux) targeting CPU execution. I followed the setup and compilation steps as per your README.md, I did compile all requirements without any issue, but Python can't find inspireface.param; import inspireface is successful, though.

Here are the detailed steps and outcomes:

Environment Setup: Docker container running Debian 10. Cloned InspireFace and the required 3rd party dependencies into the appropriate directory.
OpenCV Version: The system already had OpenCV version 4.10 installed.
MNN Compilation: Successfully compiled the MNN library provided in the 3rdparty directory.
InspireFace Compilation: Ran command/build.sh to compile InspireFace. The build was successful without any errors.
File Structure Discrepancy:

Expected Directory Structure: According to your documentation, the output should be in the inspireface-linux directory structured as:

inspireface-linux
├── include
│ ├── herror.h
│ └── inspireface.h
└── lib
└── libInspireFace.so
Actual Directory Structure: Post-compilation, the structure included an additional InspireFace directory encapsulating the include and lib directories:

inspireface-linux
├── InspireFace
│ ├── include
│ │ ├── herror.h
│ │ └── inspireface.h
│ └── lib
│ └── libInspireFace.so

The symlink for the .so file was successfully created for Python.

Python Script Issues:
The Python script fails to import inspireface.param, a module your example script requires. However, the base inspireface module imports without any errors, indicating partial success in the setup. I am trying to run the Python code on README.md, which imports inspireface.param...
Could you please provide some guidance (on properly setting up the Python bindings if actually needed, or point me to any additional documentation if setting up the symlink to .so library file is enough for Python for having successful imports)?

Thank you for your assistance!

@mario-mlc
Copy link
Author

1 week and no answers...
Did anyone try to install and configure InspireFace and got the same problems? (Python can't find Inspireface.param) and after compiling the directory structure has a InspireFace directory between inspireface-linux and the root of include and lib directories+ .so file?

@tunmx
Copy link
Contributor

tunmx commented Jul 5, 2024

Hello, the reasons for the .so file failing to load successfully are:

  1. You must copy or create a symlink for the compiled insightface.so file and place it in the python/inspireface/modules/core/ directory to ensure that the code can access it..
  2. If you are using an Anaconda virtual environment, there might be a conflict between the version of libstdc++ that the environment relies on and the version required by inspireface.so. Usually, upgrading or replacing the version of libstdc++ can resolve this issue.
  3. Your computer might be missing some libraries that OpenCV depends on.

In the new version, we have added error messages for when the inspireface.so library fails to load. You can find these messages in the console and follow the prompts to resolve the issues, for example:

python sample_face_detection.py ../test_res/pack/Pikachu ../test_res/data/bulk/face_sample.png
/home/tunm/work/InspireFace/python/inspireface/modules/core/liblibInspireFace.so.so: cannot open shared object file: No such file or directory
/home/tunm/work/InspireFace/python/inspireface/modules/core/libInspireFace.so.so: cannot open shared object file: No such file or directory
/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined symbol: g_mount_operation_set_is_tcrypt_hidden_volume
.....

Additionally, we used GitHub Actions in the development repository to deploy and test Python calls to native code, and it ran successfully. You can refer to the script for details: Script

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

No branches or pull requests

2 participants