Beispiel #1
0
 static IntPtr FaceLandmarksWithIrisCallback(IntPtr graphPtr, IntPtr packetPtr)
 {
     return(InvokeIfGraphRunnerFound <IrisTrackingGraph>(graphPtr, packetPtr, (irisTrackingGraph, ptr) => {
         using (var packet = new NormalizedLandmarkListPacket(ptr, false)) {
             if (irisTrackingGraph.TryGetPacketValue(packet, ref irisTrackingGraph.prevFaceLandmarksWithIrisMicrosec, out var value))
             {
                 irisTrackingGraph.OnFaceLandmarksWithIrisOutput.Invoke(value);
             }
         }
     }).mpPtr);
 }
Beispiel #2
0
 static IntPtr RightIrisLandmarksCallback(IntPtr graphPtr, IntPtr packetPtr)
 {
     return(InvokeIfGraphRunnerFound <HolisticTrackingGraph>(graphPtr, packetPtr, (holisticTrackingGraph, ptr) => {
         using (var packet = new NormalizedLandmarkListPacket(ptr, false)) {
             if (holisticTrackingGraph.TryGetPacketValue(packet, ref holisticTrackingGraph.prevRightIrisLandmarksMicrosec, out var value))
             {
                 holisticTrackingGraph.OnRightIrisLandmarksOutput.Invoke(value);
             }
         }
     }).mpPtr);
 }
Beispiel #3
0
 static IntPtr PoseLandmarksCallback(IntPtr graphPtr, IntPtr packetPtr)
 {
     return(InvokeIfGraphRunnerFound <PoseTrackingGraph>(graphPtr, packetPtr, (poseTrackingGraph, ptr) => {
         using (var packet = new NormalizedLandmarkListPacket(ptr, false)) {
             if (poseTrackingGraph.TryGetPacketValue(packet, ref poseTrackingGraph.prevPoseLandmarksMicrosec, out var value))
             {
                 poseTrackingGraph.OnPoseLandmarksOutput.Invoke(value);
             }
         }
     }).mpPtr);
 }
    public override Status StartRun()
    {
        poseLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(poseLandmarksStream).ConsumeValueOrDie();
        poseLandmarksPacket       = new NormalizedLandmarkListPacket();

        poseDetectionStreamPoller = graph.AddOutputStreamPoller <Detection>(poseDetectionStream).ConsumeValueOrDie();
        poseDetectionPacket       = new DetectionPacket();

        poseLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseLandmarksPresenceStream).ConsumeValueOrDie();
        poseLandmarksPresencePacket       = new BoolPacket();

        poseDetectionPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseDetectionPresenceStream).ConsumeValueOrDie();
        poseDetectionPresencePacket       = new BoolPacket();

        return(graph.StartRun());
    }
    public override Status StartRun()
    {
        poseLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(poseLandmarksStream).Value();
        poseLandmarksPacket       = new NormalizedLandmarkListPacket();

        poseRoiStreamPoller = graph.AddOutputStreamPoller <NormalizedRect>(poseRoiStream).Value();
        poseRoiPacket       = new NormalizedRectPacket();

        poseDetectionStreamPoller = graph.AddOutputStreamPoller <Detection>(poseDetectionStream).Value();
        poseDetectionPacket       = new DetectionPacket();

        faceLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(faceLandmarksStream).Value();
        faceLandmarksPacket       = new NormalizedLandmarkListPacket();

        leftHandLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(leftHandLandmarksStream).Value();
        leftHandLandmarksPacket       = new NormalizedLandmarkListPacket();

        rightHandLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(rightHandLandmarksStream).Value();
        rightHandLandmarksPacket       = new NormalizedLandmarkListPacket();

        poseLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseLandmarksPresenceStream).Value();
        poseLandmarksPresencePacket       = new BoolPacket();

        poseRoiPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseRoiPresenceStream).Value();
        poseRoiPresencePacket       = new BoolPacket();

        poseDetectionPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseDetectionPresenceStream).Value();
        poseDetectionPresencePacket       = new BoolPacket();

        faceLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(faceLandmarksPresenceStream).Value();
        faceLandmarksPresencePacket       = new BoolPacket();

        leftHandLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(leftHandLandmarksPresenceStream).Value();
        leftHandLandmarksPresencePacket       = new BoolPacket();

        rightHandLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(rightHandLandmarksPresenceStream).Value();
        rightHandLandmarksPresencePacket       = new BoolPacket();

        sidePacket = new SidePacket();
        sidePacket.Emplace("enable_iris_detection", new BoolPacket(detectIris));
        sidePacket.Emplace("model_complexity", new IntPacket((int)modelComplexity));
        sidePacket.Emplace("smooth_landmarks", new BoolPacket(smoothLandmarks));

        return(graph.StartRun(sidePacket));
    }
    public override Status StartRun()
    {
        poseLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(poseLandmarksStream).ConsumeValueOrDie();
        poseLandmarksPacket       = new NormalizedLandmarkListPacket();

        poseRoiStreamPoller = graph.AddOutputStreamPoller <NormalizedRect>(poseRoiStream).ConsumeValueOrDie();
        poseRoiPacket       = new NormalizedRectPacket();

        poseDetectionStreamPoller = graph.AddOutputStreamPoller <Detection>(poseDetectionStream).ConsumeValueOrDie();
        poseDetectionPacket       = new DetectionPacket();

        faceLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(faceLandmarksStream).ConsumeValueOrDie();
        faceLandmarksPacket       = new NormalizedLandmarkListPacket();

        leftHandLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(leftHandLandmarksStream).ConsumeValueOrDie();
        leftHandLandmarksPacket       = new NormalizedLandmarkListPacket();

        rightHandLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(rightHandLandmarksStream).ConsumeValueOrDie();
        rightHandLandmarksPacket       = new NormalizedLandmarkListPacket();

        poseLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseLandmarksPresenceStream).ConsumeValueOrDie();
        poseLandmarksPresencePacket       = new BoolPacket();

        poseRoiPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseRoiPresenceStream).ConsumeValueOrDie();
        poseRoiPresencePacket       = new BoolPacket();

        poseDetectionPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(poseDetectionPresenceStream).ConsumeValueOrDie();
        poseDetectionPresencePacket       = new BoolPacket();

        faceLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(faceLandmarksPresenceStream).ConsumeValueOrDie();
        faceLandmarksPresencePacket       = new BoolPacket();

        leftHandLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(leftHandLandmarksPresenceStream).ConsumeValueOrDie();
        leftHandLandmarksPresencePacket       = new BoolPacket();

        rightHandLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(rightHandLandmarksPresenceStream).ConsumeValueOrDie();
        rightHandLandmarksPresencePacket       = new BoolPacket();

        sidePacket = new SidePacket();
        var irisFlag = new BoolPacket(detectIris);

        sidePacket.Emplace("enable_iris_detection", irisFlag);

        return(graph.StartRun(sidePacket));
    }
Beispiel #7
0
    public override Status StartRun(SidePacket sidePacket)
    {
        handednessStreamPoller = graph.AddOutputStreamPoller <ClassificationList>(handednessStream).ConsumeValue();
        handednessPacket       = new ClassificationListPacket();

        handRectStreamPoller = graph.AddOutputStreamPoller <NormalizedRect>(handRectStream).ConsumeValue();
        handRectPacket       = new NormalizedRectPacket();

        handLandmarksStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(handLandmarksStream).ConsumeValue();
        handLandmarksPacket       = new NormalizedLandmarkListPacket();

        palmDetectionsStreamPoller = graph.AddOutputStreamPoller <List <Detection> >(palmDetectionsStream).ConsumeValue();
        palmDetectionsPacket       = new DetectionVectorPacket();

        palmDetectionsPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(palmDetectionsPresenceStream).ConsumeValue();
        palmDetectionsPresencePacket       = new BoolPacket();

        return(graph.StartRun(sidePacket));
    }
    public override Status StartRun(SidePacket sidePacket)
    {
        faceLandmarksWithIrisStreamPoller = graph.AddOutputStreamPoller <NormalizedLandmarkList>(faceLandmarksWithIrisStream).ConsumeValue();
        faceLandmarksWithIrisPacket       = new NormalizedLandmarkListPacket();

        faceRectStreamPoller = graph.AddOutputStreamPoller <NormalizedRect>(faceRectStream).ConsumeValue();
        faceRectPacket       = new NormalizedRectPacket();

        faceDetectionsStreamPoller = graph.AddOutputStreamPoller <List <Detection> >(faceDetectionsStream).ConsumeValue();
        faceDetectionsPacket       = new DetectionVectorPacket();

        faceLandmarksWithIrisPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(faceLandmarksWithIrisPresenceStream).ConsumeValue();
        faceLandmarksWithIrisPresencePacket       = new BoolPacket();

        faceDetectionsPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(faceDetectionsPresenceStream).ConsumeValue();
        faceDetectionsPresencePacket       = new BoolPacket();

        return(graph.StartRun(sidePacket));
    }