TadasBaltrusaitis / OpenFace

OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.
Other
6.71k stars 1.82k forks source link

Can I call the api in python to read the face box? #1080

Closed SakuraMaiii closed 3 months ago

SakuraMaiii commented 3 months ago

I am a beginner and can only use exe to execute commands, but it is very slow

brmarkus commented 3 months ago

Can you provide more details about your environment - which HW you are running on, which operating-system.

Which executable do you mean, how do you use it, which command-line parameters, which input (which image, which video; each which format, which codec)?

The "speed" (like framerate, throughput, latency) could depend on multiple parameters.

EDIT: Do you use the SW bare-metal, or within a container? Are you sure your environment has HW-GPU-accelerated codec-drivers? Have you tried building the sample executables on your own? Then you could try to influence to use ideal drivers for your specific HW. Can you capture any console output, which might reveal more details?

EDIT2: This rep is quite old and doesn't seem to be maintained anylonger... Depending on your underlying HW you might use something newer, state-of-the-art)?

SakuraMaiii commented 3 months ago

您能否提供有关您的环境的更多详细信息 - 您运行在哪个硬件上,哪个操作系统?

你指的是哪个可执行文件,你如何使用它,哪些命令行参数,哪个输入(哪个图像,哪个视频;每个格式,哪个编解码器)?

“速度”(如帧速率、吞吐量、延迟)可能取决于多个参数。

编辑:您是使用SW裸机,还是在容器内使用?您确定您的环境具有硬件 GPU 加速的编解码器驱动程序吗?您是否尝试过自己构建示例可执行文件?然后,您可以尝试影响为您的特定硬件使用理想的驱动程序。您能否捕获任何可能揭示更多细节的控制台输出?

编辑2:这个代表很老了,似乎不再维护了......根据您的底层硬件,您可能会使用更新、最先进的东西)?

My computer is Win10, 3090 ,and the command line I use is FaceLandmarkImg.exe -f "{face_image_path}" -out_dir "{output_dir}" -2Dfp ,I want to batch process images,But the speed is very slow, I'm not sure if you know there's a faster way.I am a beginner in the field of computer science, thank you

brmarkus commented 3 months ago

Which HW are you working on, is it a laptop, or a server? Do you have CPUs only, or also GPUs available in your system?

What information do you want to retrieve? For head-pose, facial landmarks, emotion detection, eye-gaze there are more modern applications available in the meantime. If you are running on an Intel system (CPU, GPU, NPU, VPU), then you could use OpenVINO and sample applications like "https://docs.openvino.ai/2024/omz_demos_gaze_estimation_demo_cpp.html" (in C++ and Python; typically there is only source-code available, no precompiled executables).

SakuraMaiii commented 3 months ago

Which HW are you working on, is it a laptop, or a server? Do you have CPUs only, or also GPUs available in your system?

What information do you want to retrieve? For head-pose, facial landmarks, emotion detection, eye-gaze there are more modern applications available in the meantime. If you are running on an Intel system (CPU, GPU, NPU, VPU), then you could use OpenVINO and sample applications like "https://docs.openvino.ai/2024/omz_demos_gaze_estimation_demo_cpp.html" (in C++ and Python; typically there is only source-code available, no precompiled executables).

You are a good person, thank you. I will study the document you gave me