Data container used in the editor for caching raw hand observations for inference. Holds timing, image size, and a list of RawHand entries; RawHand converts its arrays into HandObservation via MotionDocument.V.
using System.Collections.Generic;
using System.Linq;
using HumanoidMocap.Core.Inference;
using HumanoidMocap.Core.Motion;
namespace HumanoidMocap.EditorTools.Inference;
/// <summary>Shared data-only observation cache, compatible with existing editor jobs.</summary>
public sealed class RawHandSample
{
public double Time { get; set; }
public double DecoderTime { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public List<RawHand> Hands { get; set; } = new();
public sealed class RawHand
{
public string Side { get; set; } = "";
public float Presence { get; set; }
public float Handedness { get; set; }
public float[][] Image { get; set; } = System.Array.Empty<float[]>();
public float[][] RelativeWorld { get; set; } = System.Array.Empty<float[]>();
public bool Tracked { get; set; }
public HandObservation ToObservation()=>new(Side,Presence,Handedness,Image.Select(MotionDocument.V).ToArray(),RelativeWorld.Select(MotionDocument.V).ToArray(),Tracked);
}
}