예제 #1
0
        public PalmDetect(string modelPath) : base(modelPath, true)
        {
            var options = new SsdAnchorsCalcurator.Options()
            {
                inputSizeWidth  = 256,
                inputSizeHeight = 256,

                minScale = 0.1171875f,
                maxScale = 0.75f,

                anchorOffsetX = 0.5f,
                anchorOffsetY = 0.5f,

                numLayers        = 5,
                featureMapWidth  = new int[0],
                featureMapHeight = new int[0],
                strides          = new int[] { 8, 16, 32, 32, 32 },

                aspectRatios = new float[] { 1.0f },

                reduceBoxesInLowestLayer     = false,
                interpolatedScaleAspectRatio = 1.0f,
                fixedAnchorSize = true,
            };

            anchors = SsdAnchorsCalcurator.Generate(options);
            UnityEngine.Debug.AssertFormat(anchors.Length == 2944, "Anchors count must be 2944");
        }
예제 #2
0
        public PoseDetect(string modelPath) : base(modelPath, true)
        {
            var options = new SsdAnchorsCalcurator.Options()
            {
                inputSizeWidth  = 128,
                inputSizeHeight = 128,

                minScale = 0.1484375f,
                maxScale = 0.75f,

                anchorOffsetX = 0.5f,
                anchorOffsetY = 0.5f,

                numLayers        = 4,
                featureMapWidth  = new int[0],
                featureMapHeight = new int[0],
                strides          = new int[] { 8, 16, 16, 16 },

                aspectRatios = new float[] { 1.0f },

                reduceBoxesInLowestLayer     = false,
                interpolatedScaleAspectRatio = 1.0f,
                fixedAnchorSize = true,
            };

            anchors = SsdAnchorsCalcurator.Generate(options);
            UnityEngine.Debug.AssertFormat(anchors.Length == 896, $"Anchors count must be 896, but was {anchors.Length}");

            // Get Keypoint Mode
            var odim0 = interpreter.GetOutputTensorInfo(0).shape;

            KeypointsCount = (odim0[2] - 4) / 2;
        }