Steven Borkman
4 年前
当前提交
f452f55a
共有 9 个文件被更改,包括 170 次插入 和 24 次删除
-
9com.unity.perception/Runtime/GroundTruth/Labelers/KeyPointLabeler.cs
-
6com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs
-
3com.unity.perception/Runtime/Randomization/Parameters/ParameterTypes/CategorialParameters/AnimationClipParameter.cs
-
85com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/AnimationRandomizer.cs
-
7com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Tags/AnimationRandomizerTag.cs
-
62com.unity.perception/Runtime/GroundTruth/Labelers/AnimationPoseLabel.cs
-
3com.unity.perception/Runtime/GroundTruth/Labelers/AnimationPoseLabel.cs.meta
-
16com.unity.perception/Runtime/GroundTruth/Labelers/PoseStateGroundTruthInfo.cs
-
3com.unity.perception/Runtime/GroundTruth/Labelers/PoseStateGroundTruthInfo.cs.meta
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
|
|||
namespace UnityEngine.Perception.GroundTruth |
|||
{ |
|||
/// <summary>
|
|||
/// Record that maps a pose to a timestamp
|
|||
/// </summary>
|
|||
[Serializable] |
|||
public class PoseTimestampRecord |
|||
{ |
|||
/// <summary>
|
|||
/// The duration to use for this timestamp in seconds
|
|||
/// </summary>
|
|||
public float duration; |
|||
/// <summary>
|
|||
/// The label to use for any captures inside of this time period
|
|||
/// </summary>
|
|||
public string poseLabel; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// The animation pose label is a mapping that file that maps a time range in an animation clip to a ground truth
|
|||
/// pose. The timestamp record is defined by a pose label and a duration. The timestamp records are order dependent
|
|||
/// and build on the previous entries. This means that if the first record has a duration of 5, then it will be the label
|
|||
/// for all points in the clip from 0 (the beginning) to the five second mark. The next record will then go from the end
|
|||
/// of the previous clip to its duration. If there is time left over in the flip, the final entry will be used.
|
|||
/// </summary>
|
|||
[CreateAssetMenu(fileName = "AnimationPoseTimestamp", menuName = "Perception/Animation Pose Timestamps")] |
|||
public class AnimationPoseLabel : ScriptableObject |
|||
{ |
|||
/// <summary>
|
|||
/// The animation clip used for all of the timestamps
|
|||
/// </summary>
|
|||
public AnimationClip animationClip; |
|||
/// <summary>
|
|||
/// The list of timestamps, order dependent
|
|||
/// </summary>
|
|||
public List<PoseTimestampRecord> timestamps; |
|||
|
|||
/// <summary>
|
|||
/// Retrieves the pose for the clip at the current time.
|
|||
/// </summary>
|
|||
/// <param name="time">The time in question</param>
|
|||
/// <returns>The pose for the passed in time</returns>
|
|||
public string GetPoseAtTime(float time) |
|||
{ |
|||
var totalTime = 0f; |
|||
|
|||
// The amount of timestamps are expected to be small, so at the current time
|
|||
// no performance improvements are deemed necesssary
|
|||
foreach (var t in timestamps) |
|||
{ |
|||
totalTime += t.duration; |
|||
if (time < totalTime) return t.poseLabel; |
|||
} |
|||
|
|||
return timestamps.Last().poseLabel; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4c69656f5dd14516a3a18e42b3b43a4e |
|||
timeCreated: 1611270313 |
|
|||
using UnityEngine; |
|||
|
|||
namespace UnityEngine.Perception.GroundTruth |
|||
{ |
|||
/// <summary>
|
|||
/// Pose state ground truth information that can be applied to a gameobject. The typical use case
|
|||
/// is that this will be added to a labeled gameobject by a randomizer.
|
|||
/// </summary>
|
|||
public class PoseStateGroundTruthInfo : MonoBehaviour |
|||
{ |
|||
/// <summary>
|
|||
/// The pose state
|
|||
/// </summary>
|
|||
public string poseState; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 509316760ae346d1b4cac25f103fa5a7 |
|||
timeCreated: 1611613163 |
撰写
预览
正在加载...
取消
保存
Reference in new issue