Git Product home page Git Product logo

hyperinspire / inspireface Goto Github PK

View Code? Open in Web Editor NEW
46.0 46.0 12.0 466.74 MB

InspireFace is a cross-platform face recognition SDK developed in C/C++, supporting multiple operating systems and various backend types for inference, such as CPU, GPU, and NPU.

CMake 2.70% C++ 84.09% C 3.41% Shell 1.60% Python 8.19%
face face-alignment face-detection face-mask-detection face-recognition face-recognition-python face-tracking

inspireface's People

Contributors

tunmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

inspireface's Issues

ImportError: Could not load libInspireFace.so.

(base) raj@ryzenbeast:/datadisk/inspireface$ bash ci/quick_test_linux_x86_usual_python_native_interface.sh
Directory 'test_res' already exists. Skipping download.
Default or fallback case for MNN setup
CMake Deprecation Warning at 3rdparty/MNN/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Use Threadpool, forbid openmp
-- >>>>>>>>>>>>>
-- MNN BUILD INFO:
-- System: Linux
-- Processor: x86_64
-- Version: 2.8.2
-- Metal: OFF
-- OpenCL: OFF
-- OpenGL: OFF
-- Vulkan: OFF
-- ARM82: OFF
-- oneDNN: OFF
-- TensorRT: OFF
-- CoreML: OFF
-- NNAPI: OFF
-- CUDA: OFF
-- OpenMP: OFF
-- BF16: OFF
-- ThreadPool: ON
-- Hidden: TRUE
-- Build Path: /datadisk/inspireface/build/ubuntu18_shared/3rdparty/MNN
-- CUDA PROFILE: OFF
-- WIN_USE_ASM:
-- x86_64: Open SSE
-- MNN_AVX512:OFF
-- InspireFace Core:
-- Version: 1.1.4
-- MNN_INCLUDE_DIRS: /datadisk/inspireface/3rdparty/MNN/include
-- MNN_LIBS: MNN
-- ENABLE_TRACKING_BY_DETECTION: OFF
-- ISF_BUILD_SHARED_LIBS: ON
-- ISF_ENABLE_RKNN: OFF
-- InspireFace Project Global:
-- CMAKE_SYSTEM_NAME: Linux
-- CMAKE_BUILD_TYPE: Release
-- ISF_THIRD_PARTY_DIR: /datadisk/inspireface/3rdparty
-- ISF_SANITIZE_ADDRESS: OFF
-- ISF_SANITIZE_LEAK: OFF
-- ISF_ENABLE_RKNN: OFF
-- ISF_BUILD_LINUX_ARM7: OFF
-- ISF_BUILD_LINUX_AARCH64: OFF
-- ISF_BUILD_WITH_TEST: OFF
-- ISF_BUILD_WITH_SAMPLE: OFF
-- OpenCV_DIR: 3rdparty/inspireface-precompile/opencv/4.5.1/opencv-ubuntu18-x86/lib/cmake/opencv4
-- CMAKE_INSTALL_PREFIX: /datadisk/inspireface/build/ubuntu18_shared/install
-- Configuring done (0.0s)
-- Generating done (0.1s)
-- Build files have been written to: /datadisk/inspireface/build/ubuntu18_shared
[ 0%] Built target MNNMath
[ 0%] Built target MNNCV
[ 1%] Built target MNNUtils
[ 4%] Built target MNN_Express
[ 9%] Built target MNNCore
[ 12%] Built target MNNX8664
[ 15%] Built target MNNAVX
[ 17%] Built target MNNAVXFMA
[ 19%] Built target MNNSSE
[ 74%] Built target MNNCPU
[ 81%] Built target MNNTransform
[ 81%] Built target MNN
[100%] Built target InspireFace
Requirement already satisfied: opencv-python in /home/raj/miniconda3/lib/python3.11/site-packages (4.10.0.84)
Requirement already satisfied: numpy>=1.21.2 in /home/raj/miniconda3/lib/python3.11/site-packages (from opencv-python) (2.0.0)
Requirement already satisfied: click in /home/raj/miniconda3/lib/python3.11/site-packages (8.1.7)
Requirement already satisfied: loguru in /home/raj/miniconda3/lib/python3.11/site-packages (0.7.2)
/datadisk/inspireface/python/inspireface/modules/core/liblibInspireFace.so.so: cannot open shared object file: No such file or directory
/datadisk/inspireface/python/inspireface/modules/core/libInspireFace.so.so: cannot open shared object file: No such file or directory
/home/raj/miniconda3/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /datadisk/inspireface/python/inspireface/modules/core/libInspireFace.so)
/datadisk/inspireface/python/liblibInspireFace.so.so: cannot open shared object file: No such file or directory
/datadisk/inspireface/python/libInspireFace.so.so: cannot open shared object file: No such file or directory
libopencv_highgui.so.410: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/datadisk/inspireface/python/sample_face_detection.py", line 3, in
import inspireface as ifac
File "/datadisk/inspireface/python/inspireface/init.py", line 1, in
from .modules import *
File "/datadisk/inspireface/python/inspireface/modules/init.py", line 1, in
from .inspire_face import ImageStream, FaceExtended, FaceInformation, SessionCustomParameter, InspireFaceSession,
File "/datadisk/inspireface/python/inspireface/modules/inspire_face.py", line 5, in
from .core import *
File "/datadisk/inspireface/python/inspireface/modules/core/init.py", line 1, in
from .native import *
File "/datadisk/inspireface/python/inspireface/modules/core/native.py", line 870, in
_libs[_LIBRARY_FILENAME] = load_library(_LIBRARY_FILENAME)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/datadisk/inspireface/python/inspireface/modules/core/native.py", line 558, in call
raise ImportError("Could not load %s." % libname)
ImportError: Could not load libInspireFace.so.

ImportError: Could not load libInspireFace.so.

Hello, I would like to ask about an environment configuration issue. While testing on Ubuntu and following the given environment configuration requirements, I configured the environment twice. During the debugging process, the same error occurred. What could be the problem?
(InspireFace) l@l-ThinkStation-P920:/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python$ python
Python 3.8.19 (default, Mar 20 2024, 19:58:24)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

import os
import cv2
import inspireface as ifac
Traceback (most recent call last):
File "", line 1, in
File "/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python/inspireface/init.py", line 1, in
from .modules import *
File "/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python/inspireface/modules/init.py", line 1, in
from .inspire_face import ImageStream, FaceExtended, FaceInformation, SessionCustomParameter, InspireFaceSession,
File "/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python/inspireface/modules/inspire_face.py", line 3, in
from .core import *
File "/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python/inspireface/modules/core/init.py", line 1, in
from .native import *
File "/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python/inspireface/modules/core/native.py", line 870, in
_libs[_LIBRARY_FILENAME] = load_library(_LIBRARY_FILENAME)
File "/media/l/56c1a6af-6c26-4b19-8667-59642efbd717/InspireFace/python/inspireface/modules/core/native.py", line 558, in call
raise ImportError("Could not load %s." % libname)
ImportError: Could not load libInspireFace.so.

Add GPU Processing for Video Streams

Description:
We are looking to enhance the performance of InspireFace by incorporating GPU processing for handling video streams. This feature would leverage the power of GPUs to process video data more efficiently, leading to faster and more accurate face recognition and tracking.

Motivation:
Currently, the processing of video streams is handled by the CPU, which can be a bottleneck, especially when dealing with high-resolution videos or multiple video streams simultaneously. Utilizing the GPU can significantly speed up the processing time and improve the overall performance of the application. This enhancement will benefit users who require real-time face recognition and tracking capabilities.

Expected Outcome:

Improved processing speed for video streams.
Enhanced accuracy and responsiveness of face recognition and tracking.
Better resource utilization, particularly for systems with powerful GPUs.
Technical Requirements:

Identify and integrate suitable GPU-accelerated libraries or frameworks (e.g., CUDA, cuDNN, TensorFlow with GPU support, etc.).
Refactor existing code to offload video stream processing tasks to the GPU.
Ensure compatibility with various GPU models and configurations.
Implement fallbacks for systems without GPU support.
Additional Information:

Testing and benchmarking will be essential to measure the performance gains and ensure the stability of the new implementation.
Documentation updates to guide users on enabling and configuring GPU processing.
We welcome any contributions or suggestions from the community to make this feature a reality. Thank you!

请问可不可以出一个Android端的demo

在Android端导入试了,加载pack没有问题,在HFCreateInspireFaceSessionOptional这一步就会闪退,希望能出一个Android端的教程或demo参考一下。
使用的ndk版本: 26.1.10909125
测试架构:arm64-v8a
系统版本:Android13.0
opencv-android:4.10.0
这是我的代码片段
image
这是日志输出情况
image

Pre-compiling Gundam_RV1109 Model on RV1126 Fails: Request for Test Pre-Compiled Models or Guidance for Testing on RV1126

I am trying to port the project to run on an RV1126 device, but I encountered the following issues:

  1. Slow Model Loading with Full RKNPU Driver: When using the full RKNPU driver, face recognition model loading is very slow, resulting in slow recognition speed. Therefore, I want to pre-compile the model.

  2. Unpacking Gundam_RV1109 Model Files: I have unpacked the Gundam_RV1109 model files, obtaining the __inspire__ file and eight other model files. I noticed that the _02_ file is not actually used, and the _06_ file is an mnn model that also doesn't seem to be used. Therefore, I plan to pre-compile the remaining six models, but I encountered some issues.

  3. Pre-compiling Models: Pre-compiling the _00_ model was successful, but I encountered issues while pre-compiling the _03_ and _01_ _04_ _05_ _07_ models.

  4. _03_ Model Pre-compiling Error:

     root@7a64f1381911:/thonnn/rktools# python3 export_rknn_precompile_model.py Gundam_RV1109/_03_r18_Glint360K_fixed Gundam_RV1109_Output/_03_r18_Glint360K_fixed
     Use default target: rv1126
     W rknn-toolkit version: 1.7.5
     --> Loading RKNN model
     done
     --> Init runtime environment
     I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:36)
     D RKNNAPI: ==============================================
     D RKNNAPI: RKNN VERSION:
     D RKNNAPI:   API: 1.7.5 (bb79b30 build: 2023-06-20 09:54:19)
     D RKNNAPI:   DRV: 1.7.5 (bb79b30 build: 2023-07-18 10:56:54)
     D RKNNAPI: ==============================================
     done
     E RKNNAPI: rknn_query,  recv(MsgIoctl IOCTL_CMD_RKNN_PRECOMPILE) fail!
     E Catch exception when get precompile model
     E Traceback (most recent call last):
     E   File "rknn/api/rknn_base.py", line 1317, in rknn.api.rknn_base.RKNNBase.get_precompile_model_on_hardware
     E   File "rknn/api/rknn_runtime.py", line 716, in rknn.api.rknn_runtime.RKNNRuntime.get_precompile_model
     E Exception: Get precompile length failed. Error code: RKNN_ERR_DEVICE_UNAVAILABLE
     E Please feedback the detailed log file <log_feedback_to_the_rknn_toolkit_dev_team.log> to the RKNN Toolkit development team.
     E You can also check github issues: https://github.com/rockchip-linux/rknn-toolkit/issues
     E Export precompile RKNN model failed!
  5. _01_ _04_ _05_ _07_ Model Pre-compiling Warning:

     root@7a64f1381911:/thonnn/rktools# python3 export_rknn_precompile_model.py Gundam_RV1109/_04_rnet Gundam_RV1109_Output/_04_rnet                                
     Use default target: rv1126
     W rknn-toolkit version: 1.7.5
     --> Loading RKNN model
     done
     --> Init runtime environment
     I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:36)
     D RKNNAPI: ==============================================
     D RKNNAPI: RKNN VERSION:
     D RKNNAPI:   API: 1.7.5 (bb79b30 build: 2023-06-20 09:54:19)
     D RKNNAPI:   DRV: 1.7.5 (bb79b30 build: 2023-07-18 10:56:54)
     D RKNNAPI: ==============================================
     done
     W RKNNAPI: IOCTL_CMD_RKNN_PRECOMPILE fail, ack=0, data_len=0!
     W RKNNAPI: IOCTL_CMD_RKNN_PRECOMPILE fail, ack=0, data_len=0!
  6. Pre-compiling Environment:

    • Windows 11 host with Ubuntu 22.04 VM running on VMWare 17.
    • RV1126 USB ADB connected.
    • Using rknn-toolkit-1.7.5 docker image from the RKNPU website.
    • RV1126 with the latest full driver update.
    • Pre-compile script: export_rknn_precompile_model.py from the rknn-toolkit github example.
  7. My Requests:

    • Could you please provide the pre-compiled model files you used for testing?
    • Alternatively, I saw that the project’s Benchmark Remark includes RV1126 test results. Could you provide some guidance on how you tested on the RV1126?

Thank you for your assistance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.