google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
26.83k stars 5.09k forks source link

How to only recognition face on an holistic framework, do you support? Thank you very much #3648

Closed xxqwf closed 1 year ago

xxqwf commented 2 years ago

@sgowroji

liuyulvv commented 2 years ago

You need to new a holistic_landmark_only_face.pbtxt like holistic_landmark_cpu.pbtxt, and remove HandLandmark, PoseLandmark can't be removed because FaceLandmark need its output.

Why don't you try FaceMesh?

xxqwf commented 2 years ago

@liuyulvv 你好, 我想构建一个包,应用在不同的场景! 例如, 只识别手势、或者姿势! 但是我构建的holistic同时输出面部、姿势、手势. 导致大多数手机卡顿

liuyulvv commented 2 years ago

@xxqwf Hand是只识别手势的,Pose是只识别姿势的。

Holistic本来就是面部、姿势、手势的集成方案。如果你想一个包根据需求只检测某一部分的话,你可以试试将Holistic打包成一个库(我不懂安卓,在pc上是打包成链接库),然后根据需求建立自己的graph在运行的时候更改graph参数(pc命令行里面的--calculator_graph_config_file),在graph里面去掉不需要的calculatoroutput_stream

sureshdagooglecom commented 2 years ago

Hi @xxqwf , Yes , we do have face deteciton solution in MediaPipe , please check this link.

xxqwf commented 2 years ago

Hi @xxqwf , Yes , we do have face deteciton solution in MediaPipe , please check this link.

How to pack Hand and Pose into an AAR, they do not affect each other

xxqwf commented 2 years ago

@xxqwf Hand是只识别手势的,Pose是只识别姿势的。

Holistic本来就是面部、姿势、手势的集成方案。如果你想一个包根据需求只检测某一部分的话,你可以试试将Holistic打包成一个库(我不懂安卓,在pc上是打包成链接库),然后根据需求建立自己的graph在运行的时候更改graph参数(pc命令行里面的--calculator_graph_config_file),在graph里面去掉不需要的calculatoroutput_stream

我试了更改不同的graph, 好像不行。我现在想构建一个包,让他包含HandPose,但是我不太清楚Build里的内容!

liuyulvv commented 2 years ago

@xxqwf 从这里可以看到Holistic的输出除了Hand和Pose,还有Face的。

Face的输出是在这里计算的,直接注释掉,graph那边Face相关的output_stream这里也注释掉,应该是可以的。

xxqwf commented 2 years ago

@liuyulvv 我尝试修改了这些,还是没跑起来

liuyulvv commented 2 years ago

@xxqwf 我注释了这些地方,在PC上CPU跑起来了

1 2 3 4 5 6 7

xxqwf commented 2 years ago

@xxqwf 我注释了这些地方,在PC上CPU跑起来了

1 2 3 4 5 6 7

谢谢啦, 按照你的方法跑起来了!

xxqwf commented 2 years ago

@liuyulvv 只包含HandPoseHolistic包,帧数有明显提高,但还是有些卡顿。怎样能把Hand和'Pose'打到同一个包里, 并且当使用Hand的时候不启用Pose,当使用'Pose'的时候不启用'Hand',老哥你有研究过这个方案吗

liuyulvv commented 2 years ago

@xxqwf PC上我是做到了,就是把Pose和Hand打包成动态链接库,main函数根据需求读取graph就行了

liuyulvv commented 2 years ago

都可以吧,只要你可执行文件链接上就可以。我是打包成一个,要不然要写两个头文件接口。

打包成一个动态链接库,还是两个呢

xxqwf commented 2 years ago

都可以吧,只要你可执行文件链接上就可以。我是打包成一个,要不然要写两个头文件接口。

打包成一个动态链接库,还是两个呢

可以参考下你写的Build文件吗

liuyulvv commented 2 years ago

@xxqwf DLL这个是把Holistic和Iris打包在一起的,只是测试用的

kuaashish commented 2 years ago

Hi @xxqwf, Have you looked at this similar closed issue #2028 and #2028(comment) will give you a better understanding of modifying the internal graphs. Thank you!

google-ml-butler[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 1 year ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No