예제 #1
0
        void Start()
        {
            detector = new PoseDetector(resource);
            material = new Material(shader);

            boxDrawArgs  = new ComputeBuffer(4, sizeof(uint), ComputeBufferType.IndirectArguments);
            lineDrawArgs = new ComputeBuffer(4, sizeof(uint), ComputeBufferType.IndirectArguments);

            boxDrawArgs.SetData(new[] { 3 * 2, 0, 0, 0 });
            lineDrawArgs.SetData(new[] { 2, 0, 0, 0 });
        }
예제 #2
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);
        }