Steve Borkman
3 年前
当前提交
dab48757
共有 3 个文件被更改,包括 30 次插入 和 51 次删除
-
8com.unity.perception/Runtime/GroundTruth/Labelers/CocoKeypointTemplate.asset
-
36com.unity.perception/Runtime/GroundTruth/Labelers/KeypointLabeler.cs
-
37com.unity.perception/Runtime/GroundTruth/Labelers/KeypointOcclusionOverrides.cs
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
[Serializable] |
|||
public struct KeypointOcclusionOverride |
|||
{ |
|||
public string label; |
|||
public float distance; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// When attached to a model used by the <see cref="KeypointLabeler"/> overrides the distance values
|
|||
/// for each keypoint defined in <see cref="KeypointTemplate"/> by multiplying them by this overrideDistanceScale
|
|||
/// scalar. The values in <see cref="KeypointTemplate"/> are generally set for a typical adult model, which makes it
|
|||
/// so that these values do not meet the needs of models with different body types (i.e. children, different heights, different weights).
|
|||
/// Changing the value of the scalar will help to get keypoint occlusion working properly for these models. A value of 1.0
|
|||
/// will use the template values as is.
|
|||
/// </summary>
|
|||
public float overrideDistanceScale = 1.0f; |
|||
#if false
|
|||
public Dictionary<string, float> overridesMap { get; private set; } |
|||
public List<KeypointOcclusionOverride> keypointOcclusionOverrides; |
|||
[Tooltip("Overrides the default occlusion distance values by a scalar. This is necessary for bodies with different body types (i.e. children should be less than one)")] |
|||
[SerializeField] |
|||
// ReSharper disable once InconsistentNaming, this needs to be human readable in the inspector
|
|||
float distanceScale = 1.0f; |
|||
void Start() |
|||
/// <summary>
|
|||
/// The value to use to scale the values for keypoints distances defined in <see cref="KeypointTemplate"/>
|
|||
/// </summary>
|
|||
public float overrideDistanceScale |
|||
overridesMap = new Dictionary<string, float>(keypointOcclusionOverrides.Count); |
|||
foreach (var kpOverride in keypointOcclusionOverrides) |
|||
{ |
|||
overridesMap[kpOverride.label] = kpOverride.distance; |
|||
} |
|||
get => distanceScale; |
|||
private set => distanceScale = value; |
|||
#endif
|
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue