Webカメラの映像から人物だけ抽出したい、などの用途があると思います。
今回は、Mediapipeを使用してWebCameraからのリアルタイム動画をAIで解析し、人物抽出をしてみます。
MediapipeのSelfieSegmentation
Meidapipe for Unity
0.8.3 版ではデフォルトではSelfieSegmentationが入っていませんが、こちらを入れ込む実装を行いリビルドし直せば使えます。
背景の2Dと人物のリアルタイム合成した結果
MediapipeでDepthカメラがなくてもこれだけちゃんと人と認識してくれるんだから凄いですね!
mediapipeとunityの連携の仕方を教えてほしいです。。。
ゆ様
コメントありがとうございます。
連携の仕方に関しましては、以下インストールガイドを行いました。
https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide
ご参考になれば幸いです。
wow!
The result you got is very good, may I ask what changes you made in the original code?
Thank you!
The necessary information is taken from “MediaPipe for Unity”‘s Example and the Selfie segmentation image is masked with ShaderGraph.
A Face Mesh is also obtained at the same time, which is drawn with LineRanderer and SpriteRenderer.
Since the original code requires each of them to be obtained separately, we have modified it so that they can be obtained all at once.
thanks a lot for your response,
may I ask you please explain it more, I’m a newbie, and I would appreciate it!
actually, I’m still trying to figure out how can I do the same
are you talking about the OnSegmentationMaskOutput function (in the SelfieSegmentationSolution.cs file)?
Thanks for the question.
My implementation did not use SelfieSegmentationSolution but created its own Solution.
The text file to be loaded is also not prepared.
With this I am trying to create an app.
Please stay tuned!