Beispiel #1
0
        public BlazePoseDetector(BlazePoseResource resource, LandmarkModelType modelType)
        {
            this.resource = resource;

            detector   = new PoseDetector(resource.detectionResource);
            landmarker = new PoseLandMarker(resource.landmarkResource, modelType);

            letterboxTexture = RTUtil.NewUAV(DETECTION_INPUT_IMAGE_SIZE, DETECTION_INPUT_IMAGE_SIZE, 0, RenderTextureFormat.ARGB32, GraphicsFormat.R8G8B8A8_UNorm);
            croppedTexture   = RTUtil.NewUAV(LANDMARK_INPUT_IMAGE_SIZE, LANDMARK_INPUT_IMAGE_SIZE, 0, RenderTextureFormat.ARGB32, GraphicsFormat.R8G8B8A8_UNorm);

            poseRegionBuffer       = new ComputeBuffer(1, sizeof(float) * 24);
            deltaOutputBuffer      = new ComputeBuffer(landmarker.KeypointCount, sizeof(float) * 4);
            deltaOutputWorldBuffer = new ComputeBuffer(landmarker.KeypointCount, sizeof(float) * 4);

            // feature 33 + human exist flag 1
            outputBuffer      = new ComputeBuffer(landmarker.KeypointCount + 1, sizeof(float) * 4);
            outputWorldBuffer = new ComputeBuffer(landmarker.KeypointCount + 1, sizeof(float) * 4);
        }
Beispiel #2
0
 void Start()
 {
     landMarker = new PoseLandMarker(resource, modelType);
     material   = new Material(shader);
 }