-
-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: render annotations in PoseTracking scenes
- Loading branch information
Showing
19 changed files
with
570 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
Assets/Mediapipe/Examples/PoseTracking/Objects/PoseTrackingAnnotation.prefab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!1 &8155280967966332756 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 8155280967966332758} | ||
- component: {fileID: -7409172497499427214} | ||
m_Layer: 0 | ||
m_Name: PoseTrackingAnnotation | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &8155280967966332758 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8155280967966332756} | ||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | ||
m_LocalPosition: {x: 0, y: 0, z: -20} | ||
m_LocalScale: {x: 1, y: 1, z: 1} | ||
m_Children: [] | ||
m_Father: {fileID: 0} | ||
m_RootOrder: 0 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!114 &-7409172497499427214 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8155280967966332756} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 178c0f33a7c561b3db556cab0a69aa75, type: 3} | ||
m_Name: | ||
m_EditorClassIdentifier: | ||
poseLandmarkListPrefab: {fileID: 2712965234984282611, guid: 52f3167d117fe05eb8f7ae8c84e4d403, | ||
type: 3} | ||
poseRectPrefab: {fileID: 1405412484651109527, guid: c5c846cc7bbefdfa7af64f9d29912b70, | ||
type: 3} | ||
poseDetectionPrefab: {fileID: 1405412484651109527, guid: 3779864e7ead10e31b03fc362f4746de, | ||
type: 3} |
7 changes: 7 additions & 0 deletions
7
Assets/Mediapipe/Examples/PoseTracking/Objects/PoseTrackingAnnotation.prefab.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
Assets/Mediapipe/Examples/PoseTracking/Scripts/PoseTrackingAnnotationController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Mediapipe; | ||
using UnityEngine; | ||
|
||
public class PoseTrackingAnnotationController : AnnotationController { | ||
[SerializeField] GameObject poseLandmarkListPrefab = null; | ||
[SerializeField] GameObject poseDetectionPrefab = null; | ||
|
||
private GameObject poseLandmarkListAnnotation; | ||
private GameObject poseDetectionAnnotation; | ||
|
||
void Awake() { | ||
poseLandmarkListAnnotation = Instantiate(poseLandmarkListPrefab); | ||
poseDetectionAnnotation = Instantiate(poseDetectionPrefab); | ||
} | ||
|
||
public override void Clear() { | ||
poseLandmarkListAnnotation.GetComponent<PoseLandmarkListAnnotationController>().Clear(); | ||
poseDetectionAnnotation.GetComponent<DetectionAnnotationController>().Clear(); | ||
} | ||
|
||
public void Draw(Transform screenTransform, NormalizedLandmarkList poseLandmarkList, Detection poseDetection, bool isFlipped = false) | ||
{ | ||
poseLandmarkListAnnotation.GetComponent<PoseLandmarkListAnnotationController>().Draw(screenTransform, poseLandmarkList, isFlipped); | ||
poseDetectionAnnotation.GetComponent<DetectionAnnotationController>().Draw(screenTransform, poseDetection, isFlipped); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Mediapipe/Examples/PoseTracking/Scripts/PoseTrackingAnnotationController.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.