public override Status StartRun() { handLandmarksStreamPoller = graph.AddOutputStreamPoller <List <NormalizedLandmarkList> >(handLandmarksStream).ConsumeValueOrDie(); handLandmarksPacket = new NormalizedLandmarkListVectorPacket(); handednessStreamPoller = graph.AddOutputStreamPoller <List <ClassificationList> >(handednessStream).ConsumeValueOrDie(); handednessPacket = new ClassificationListVectorPacket(); palmDetectionsStreamPoller = graph.AddOutputStreamPoller <List <Detection> >(palmDetectionsStream).ConsumeValueOrDie(); palmDetectionsPacket = new DetectionVectorPacket(); palmRectsStreamPoller = graph.AddOutputStreamPoller <List <NormalizedRect> >(palmRectsStream).ConsumeValueOrDie(); palmRectsPacket = new NormalizedRectVectorPacket(); handLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(handLandmarksPresenceStream).ConsumeValueOrDie(); handLandmarksPresencePacket = new BoolPacket(); palmDetectionsPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(palmDetectionsPresenceStream).ConsumeValueOrDie(); palmDetectionsPresencePacket = new BoolPacket(); sidePacket = new SidePacket(); sidePacket.Emplace("num_hands", new IntPacket(2)); return(graph.StartRun(sidePacket)); }
public override Status StartRun(SidePacket sidePacket) { landmarkStreamPoller = graph.AddOutputStreamPoller <List <Landmark[]> >(landmarkStream).ConsumeValue(); landmarkPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(landmarkPresenceStream).ConsumeValue(); landmarkListPacket = new NormalizedLandmarkListVectorPacket(); landmarkPresencePacket = new BoolPacket(); return(graph.StartRun(sidePacket)); }
static IntPtr HandLandmarksCallback(IntPtr graphPtr, IntPtr packetPtr) { return(InvokeIfGraphRunnerFound <HandTrackingGraph>(graphPtr, packetPtr, (handTrackingGraph, ptr) => { using (var packet = new NormalizedLandmarkListVectorPacket(ptr, false)) { if (handTrackingGraph.TryGetPacketValue(packet, ref handTrackingGraph.prevHandLandmarksMicrosec, out var value)) { handTrackingGraph.OnHandLandmarksOutput.Invoke(value); } } }).mpPtr); }
static IntPtr MultiFaceLandmarksCallback(IntPtr graphPtr, IntPtr packetPtr) { return(InvokeIfGraphRunnerFound <FaceMeshGraph>(graphPtr, packetPtr, (faceMeshGraph, ptr) => { using (var packet = new NormalizedLandmarkListVectorPacket(ptr, false)) { if (faceMeshGraph.TryGetPacketValue(packet, ref faceMeshGraph.prevMultiFaceLandmarksMicrosec, out var value)) { faceMeshGraph.OnMultiFaceLandmarksOutput.Invoke(value); } } }).mpPtr); }
public override Status StartRun(SidePacket sidePacket) { multiHandLandmarksStreamPoller = graph.AddOutputStreamPoller <List <NormalizedLandmarkList> >(multiHandLandmarksStream).ConsumeValue(); multiHandLandmarksPacket = new NormalizedLandmarkListVectorPacket(); multiPalmDetectionsStreamPoller = graph.AddOutputStreamPoller <List <Detection> >(multiPalmDetectionsStream).ConsumeValue(); multiPalmDetectionsPacket = new DetectionVectorPacket(); multiPalmRectsStreamPoller = graph.AddOutputStreamPoller <List <NormalizedRect> >(multiPalmRectsStream).ConsumeValue(); multiPalmRectsPacket = new NormalizedRectVectorPacket(); multiPalmDetectionsPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(multiPalmDetectionsPresenceStream).ConsumeValue(); multiPalmDetectionsPresencePacket = new BoolPacket(); return(graph.StartRun(sidePacket)); }
public override Status StartRun() { multiFaceLandmarksStreamPoller = graph.AddOutputStreamPoller <List <NormalizedLandmarkList> >(multiFaceLandmarksStream).ConsumeValueOrDie(); multiFaceLandmarksPacket = new NormalizedLandmarkListVectorPacket(); faceRectsFromLandmarksStreamPoller = graph.AddOutputStreamPoller <List <NormalizedRect> >(faceRectsFromLandmarksStream).ConsumeValueOrDie(); faceRectsFromLandmarksPacket = new NormalizedRectVectorPacket(); faceDetectionsStreamPoller = graph.AddOutputStreamPoller <List <Detection> >(faceDetectionsStream).ConsumeValueOrDie(); faceDetectionsPacket = new DetectionVectorPacket(); multiFacelandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(multiFaceLandmarksPresenceStream).ConsumeValueOrDie(); multiFaceLandmarksPresencePacket = new BoolPacket(); faceDetectionsPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(faceDetectionsPresenceStream).ConsumeValueOrDie(); faceDetectionsPresencePacket = new BoolPacket(); sidePacket = new SidePacket(); sidePacket.Emplace("num_faces", new IntPacket(numFaces)); return(graph.StartRun(sidePacket)); }