public override Status StartRun()
        {
            handLandmarksStreamPoller = graph.AddOutputStreamPoller <List <NormalizedLandmarkList> >(handLandmarksStream).Value();
            handLandmarksPacket       = new NormalizedLandmarkListVectorPacket();

            handednessStreamPoller = graph.AddOutputStreamPoller <List <ClassificationList> >(handednessStream).Value();
            handednessPacket       = new ClassificationListVectorPacket();

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

            palmRectsStreamPoller = graph.AddOutputStreamPoller <List <NormalizedRect> >(palmRectsStream).Value();
            palmRectsPacket       = new NormalizedRectVectorPacket();

            handLandmarksPresenceStreamPoller = graph.AddOutputStreamPoller <bool>(handLandmarksPresenceStream).Value();
            handLandmarksPresencePacket       = new BoolPacket();

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

            sidePacket = new SidePacket();
            sidePacket.Emplace("num_hands", new IntPacket(2));

            return(graph.StartRun(sidePacket));
        }
Ejemplo n.º 2
0
    public HelloWorldGraph() : base(configText)
    {
        var statusOrPoller = AddOutputStreamPoller("out");

        if (!statusOrPoller.IsOk())
        {
            Debug.Log("Failed to add output stream: out");

            // TODO: select an appropriate exception class, and read the status
            throw new System.SystemException(statusOrPoller.status.ToString());
        }

        outputStreamPoller = statusOrPoller.GetValue();
    }