コード例 #1
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize) :
     this(poseMode,
          netInputSize,
          DefaultOutputSize)
 {
 }
コード例 #2
0
 public static extern IntPtr op_wrapperStructPose_new(PoseMode poseMode,
                                                      IntPtr netInputSize,
                                                      IntPtr outputSize,
                                                      ScaleMode keypointScale,
                                                      int gpuNumber,
                                                      int gpuNumberStart,
                                                      int scalesNumber,
                                                      float scaleGap,
                                                      RenderMode renderMode,
                                                      PoseModel poseModel,
                                                      bool blendOriginalFrame,
                                                      float alphaKeypoint,
                                                      float alphaHeatMap,
                                                      int defaultPartToRender,
                                                      byte[] modelFolder,
                                                      IntPtr heatMapTypes,
                                                      ScaleMode heatMapScale,
                                                      bool addPartCandidates,
                                                      float renderThreshold,
                                                      int numberPeopleMax,
                                                      bool maximizePositives,
                                                      double fpsMax,
                                                      byte[] protoTxtPath,
                                                      byte[] caffeModelPath,
                                                      float upsamplingRatio,
                                                      bool enableGoogleLogging);
コード例 #3
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber,
                          int gpuNumberStart,
                          int scalesNumber,
                          float scaleGap,
                          RenderMode renderMode,
                          PoseModel poseModel,
                          bool blendOriginalFrame,
                          float alphaKeyPoint,
                          float alphaHeatMap,
                          int defaultPartToRender,
                          string modelFolder,
                          IEnumerable <HeatMapType> heatMapTypes) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          gpuNumberStart,
          scalesNumber,
          scaleGap,
          renderMode,
          poseModel,
          blendOriginalFrame,
          alphaKeyPoint,
          alphaHeatMap,
          defaultPartToRender,
          modelFolder,
          heatMapTypes,
          ScaleMode.ZeroToOne)
 {
 }
コード例 #4
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber,
                          int gpuNumberStart,
                          int scalesNumber,
                          float scaleGap,
                          RenderMode renderMode,
                          PoseModel poseModel,
                          bool blendOriginalFrame,
                          float alphaKeyPoint,
                          float alphaHeatMap,
                          int defaultPartToRender) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          gpuNumberStart,
          scalesNumber,
          scaleGap,
          renderMode,
          poseModel,
          blendOriginalFrame,
          alphaKeyPoint,
          alphaHeatMap,
          defaultPartToRender,
          "models/")
 {
 }
コード例 #5
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber,
                          int gpuNumberStart,
                          int scalesNumber,
                          float scaleGap,
                          RenderMode renderMode,
                          PoseModel poseModel,
                          bool blendOriginalFrame,
                          float alphaKeyPoint) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          gpuNumberStart,
          scalesNumber,
          scaleGap,
          renderMode,
          poseModel,
          blendOriginalFrame,
          alphaKeyPoint,
          OpenPose.PoseDefaultAlphaKeyPoint)
 {
 }
コード例 #6
0
        // Pose parameter configuration (with default value)
        // Please refer to OpenPose documentation for parameter explanation
        public static void OPConfigurePose(
            PoseMode poseMode           = PoseMode.Enabled, Vector2Int?netInputSize = null, Vector2Int?outputSize = null,
            ScaleMode keypointScaleMode = ScaleMode.InputResolution,
            int gpuNumber            = -1, int gpuNumberStart = 0, int scalesNumber = 1, float scaleGap = 0.25f,
            RenderMode renderMode    = RenderMode.Auto, PoseModel poseModel = PoseModel.BODY_25,
            bool blendOriginalFrame  = true, float alphaKeypoint            = 0.6f, float alphaHeatMap = 0.7f,
            int defaultPartToRender  = 0, string modelFolder = null,
            HeatMapType heatMapTypes = HeatMapType.None, ScaleMode heatMapScaleMode = ScaleMode.ZeroToOne,
            bool addPartCandidates   = false, float renderThreshold = 0.05f, int numberPeopleMax = -1,
            bool maximizePositives   = false, double fpsMax         = -1.0,
            string protoTxtPath      = "", string caffeModelPath    = "", float upsamplingRatio = 0f)
        {
            // Other default values
            Vector2Int _netRes    = netInputSize ?? new Vector2Int(-1, 368);
            Vector2Int _outputRes = outputSize ?? new Vector2Int(-1, -1);

            modelFolder = modelFolder ?? Environment.CurrentDirectory + "/models/";

            Bind._OPConfigurePose(
                (byte)poseMode, _netRes.x, _netRes.y, // Point
                _outputRes.x, _outputRes.y,           // Point
                (byte)keypointScaleMode,              // ScaleMode
                gpuNumber, gpuNumberStart, scalesNumber, scaleGap,
                (byte)renderMode,                     // RenderMode
                (byte)poseModel,                      // PoseModel
                blendOriginalFrame, alphaKeypoint, alphaHeatMap, defaultPartToRender, modelFolder,
                Convert.ToBoolean(heatMapTypes & HeatMapType.Parts),
                Convert.ToBoolean(heatMapTypes & HeatMapType.Background),
                Convert.ToBoolean(heatMapTypes & HeatMapType.PAFs), // vector<HeatMapType>
                (byte)heatMapScaleMode,                             // ScaleMode
                addPartCandidates, renderThreshold, numberPeopleMax,
                maximizePositives, fpsMax, protoTxtPath, caffeModelPath, upsamplingRatio
                );
        }
コード例 #7
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize) :
     this(poseMode,
          netInputSize,
          outputSize,
          ScaleMode.InputResolution)
 {
 }
コード例 #8
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          -1)
 {
 }
コード例 #9
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber,
                          int gpuNumberStart,
                          int scalesNumber,
                          float scaleGap,
                          RenderMode renderMode,
                          PoseModel poseModel,
                          bool blendOriginalFrame,
                          float alphaKeyPoint,
                          float alphaHeatMap,
                          int defaultPartToRender,
                          string modelFolder,
                          IEnumerable <HeatMapType> heatMapTypes,
                          ScaleMode heatMapScale,
                          bool addPartCandidates,
                          float renderThreshold,
                          int numberPeopleMax,
                          bool maximizePositives,
                          double fpsMax,
                          string prototxtPath,
                          string caffeModelPath,
                          float upsamplingRatio) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          gpuNumberStart,
          scalesNumber,
          scaleGap,
          renderMode,
          poseModel,
          blendOriginalFrame,
          alphaKeyPoint,
          alphaHeatMap,
          defaultPartToRender,
          modelFolder,
          heatMapTypes,
          heatMapScale,
          addPartCandidates,
          renderThreshold,
          numberPeopleMax,
          maximizePositives,
          fpsMax,
          prototxtPath,
          caffeModelPath,
          upsamplingRatio,
          true)
 {
 }
コード例 #10
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          0)
 {
 }
コード例 #11
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber,
                          int gpuNumberStart,
                          int scalesNumber,
                          float scaleGap,
                          RenderMode renderMode,
                          PoseModel poseModel,
                          bool blendOriginalFrame,
                          float alphaKeyPoint,
                          float alphaHeatMap,
                          int defaultPartToRender,
                          string modelFolder,
                          IEnumerable <HeatMapType> heatMapTypes,
                          ScaleMode heatMapScale,
                          bool addPartCandidates,
                          float renderThreshold,
                          int numberPeopleMax) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          gpuNumberStart,
          scalesNumber,
          scaleGap,
          renderMode,
          poseModel,
          blendOriginalFrame,
          alphaKeyPoint,
          alphaHeatMap,
          defaultPartToRender,
          modelFolder,
          heatMapTypes,
          heatMapScale,
          addPartCandidates,
          renderThreshold,
          numberPeopleMax,
          false)
 {
 }
コード例 #12
0
 public WrapperStructPose(PoseMode poseMode,
                          Point <int> netInputSize,
                          Point <int> outputSize,
                          ScaleMode keyPointScale,
                          int gpuNumber,
                          int gpuNumberStart,
                          int scalesNumber,
                          float scaleGap) :
     this(poseMode,
          netInputSize,
          outputSize,
          keyPointScale,
          gpuNumber,
          gpuNumberStart,
          scalesNumber,
          scaleGap,
          RenderMode.Gpu)
 {
 }
コード例 #13
0
ファイル: CharXML.cs プロジェクト: luddchen/XGame
        private static void writePose(XmlTextWriter writer, Pose pose, Pose basePose, TextureNode root)
        {
            if (basePose != pose)     // exclude BasePose
            {
                PoseMode poseMode = pose.Mode;
                WriteElement(writer, "Pose", new string[] { "name", "type" }, new string[] { pose.Text, poseMode.ToString() });

                if (pose.PoseNodes.Count > 0 && poseMode == PoseMode.Pose)
                {
                    foreach (PoseNode poseNode in pose.PoseNodes)
                    {
                        PoseNode baseNode = basePose.GetNode(poseNode.Node);    // check null ?

                        string[] values = { poseNode.Node.Text, poseNode.Node.GetIndexPath() };
                        WriteElement(writer, "PoseNode", new string[] { "name", "path" }, values);

                        foreach (string property in poseNode.Properties.Keys)
                        {
                            string[] pValues = new string[] { property, poseNode.Properties[property].ToString() };
                            WriteElement(writer, "Property", new string[] { "name", "value" }, pValues, true);
                        }

                        writer.WriteEndElement();
                    }
                }
                else
                {
                    WriteElement(writer, "Equals", new string[] { "Pose" }, new String[] { basePose.Text }, true);
                }

                foreach (TreeNode subPose in pose.Nodes)
                {
                    writePose(writer, subPose as Pose, basePose, root);
                }

                writer.WriteEndElement();
            }
        }
コード例 #14
0
 public static extern void op_wrapperStructPose_set_poseMode(IntPtr face, PoseMode poseMode);
コード例 #15
0
        public WrapperStructPose(PoseMode poseMode,
                                 Point <int> netInputSize,
                                 Point <int> outputSize,
                                 ScaleMode keyPointScale,
                                 int gpuNumber,
                                 int gpuNumberStart,
                                 int scalesNumber,
                                 float scaleGap,
                                 RenderMode renderMode,
                                 PoseModel poseModel,
                                 bool blendOriginalFrame,
                                 float alphaKeyPoint,
                                 float alphaHeatMap,
                                 int defaultPartToRender,
                                 string modelFolder,
                                 IEnumerable <HeatMapType> heatMapTypes,
                                 ScaleMode heatMapScale,
                                 bool addPartCandidates,
                                 float renderThreshold,
                                 int numberPeopleMax,
                                 bool maximizePositives,
                                 double fpsMax,
                                 string prototxtPath,
                                 string caffeModelPath,
                                 float upsamplingRatio,
                                 bool enableGoogleLogging)
        {
            var modelFolderBytes    = Encoding.UTF8.GetBytes(modelFolder ?? "");
            var prototxtPathBytes   = Encoding.UTF8.GetBytes(prototxtPath ?? "");
            var caffeModelPathBytes = Encoding.UTF8.GetBytes(caffeModelPath ?? "");

            using (var nativeNetInputSize = netInputSize.ToNative())
                using (var nativeOutputSize = outputSize.ToNative())
                    using (var vector = new StdVector <HeatMapType>(heatMapTypes ?? new HeatMapType[0]))
                        this.NativePtr = NativeMethods.op_wrapperStructPose_new(poseMode,
                                                                                nativeNetInputSize.NativePtr,
                                                                                nativeOutputSize.NativePtr,
                                                                                keyPointScale,
                                                                                gpuNumber,
                                                                                gpuNumberStart,
                                                                                scalesNumber,
                                                                                scaleGap,
                                                                                renderMode,
                                                                                poseModel,
                                                                                blendOriginalFrame,
                                                                                alphaKeyPoint,
                                                                                alphaHeatMap,
                                                                                defaultPartToRender,
                                                                                modelFolderBytes,
                                                                                vector.NativePtr,
                                                                                heatMapScale,
                                                                                addPartCandidates,
                                                                                renderThreshold,
                                                                                numberPeopleMax,
                                                                                maximizePositives,
                                                                                fpsMax,
                                                                                prototxtPathBytes,
                                                                                caffeModelPathBytes,
                                                                                upsamplingRatio,
                                                                                enableGoogleLogging);
        }
コード例 #16
0
 public WrapperStructPose(PoseMode poseMode) :
     this(poseMode,
          DefaultNetInputSize)
 {
 }