Unity と Mediapipe でリアルタイム合成

Webカメラの映像から人物だけ抽出したい、などの用途があると思います。

今回は、Mediapipeを使用してWebCameraからのリアルタイム動画をAIで解析し、人物抽出をしてみます。

MediapipeのSelfieSegmentation

Meidapipe for Unity

0.8.3 版ではデフォルトではSelfieSegmentationが入っていませんが、こちらを入れ込む実装を行いリビルドし直せば使えます。

背景の2Dと人物のリアルタイム合成した結果

MediapipeでDepthカメラがなくてもこれだけちゃんと人と認識してくれるんだから凄いですね!

「Unity と Mediapipe でリアルタイム合成」への6件のフィードバック

    1. 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.

      1. 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)?

        1. 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!

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください