Exemplo n.º 1
0
        // User can change the settings here
        private void UserConfigureOpenPose()
        {
            OPWrapper.OPConfigurePose(
                /* poseMode */ PoseMode.Enabled, /* netInputSize */ netResolution, /* outputSize */ null,
                /* keypointScaleMode */ ScaleMode.InputResolution,
                /* gpuNumber */ -1, /* gpuNumberStart */ 0, /* scalesNumber */ 1, /* scaleGap */ 0.3f,
                /* renderMode */ RenderMode.Gpu, /* poseModel */ PoseModel.BODY_25,
                /* blendOriginalFrame */ true, /* alphaKeypoint */ 0.6f, /* alphaHeatMap */ 0.7f,
                /* defaultPartToRender */ 0, /* modelFolder */ null,
                /* heatMapTypes */ HeatMapType.None, /* heatMapScaleMode */ ScaleMode.UnsignedChar,
                /* addPartCandidates */ false, /* renderThreshold */ renderThreshold, /* numberPeopleMax */ maxPeople,
                /* maximizePositives */ false, /* fpsMax fps_max */ -1.0,
                /* protoTxtPath */ "", /* caffeModelPath */ "", /* upsamplingRatio */ 0f);

            OPWrapper.OPConfigureHand(
                /* enable */ handEnabled, /* detector */ Detector.Body, /* netInputSize */ handResolution,
                /* scalesNumber */ 1, /* scaleRange */ 0.4f, /* renderMode */ RenderMode.None,
                /* alphaKeypoint */ 0.6f, /* alphaHeatMap */ 0.7f, /* renderThreshold */ 0.2f);

            OPWrapper.OPConfigureFace(
                /* enable */ faceEnabled, /* detector */ Detector.Body,
                /* netInputSize */ faceResolution, /* renderMode */ RenderMode.None,
                /* alphaKeypoint */ 0.6f, /* alphaHeatMap */ 0.7f, /* renderThreshold */ 0.4f);

            OPWrapper.OPConfigureExtra(
                /* reconstruct3d */ false, /* minViews3d */ -1, /* identification */ false, /* tracking */ -1,
                /* ikThreads */ 0);

            OPWrapper.OPConfigureInput(
                /* producerType */ inputType, /* producerString */ producerString,
                /* frameFirst */ 0, /* frameStep */ 1, /* frameLast */ ulong.MaxValue,
                /* realTimeProcessing */ false, /* frameFlip */ false,
                /* frameRotate */ 0, /* framesRepeat */ false,
                /* cameraResolution */ null, /* cameraParameterPath */ null,
                /* undistortImage */ false, /* numberViews */ -1);

            OPWrapper.OPConfigureOutput(
                /* verbose */ -1.0, /* writeKeypoint */ "", /* writeKeypointFormat */ DataFormat.Yml,
                /* writeJson */ "", /* writeCocoJson */ "", /* writeCocoFootJson */ "",
                /* writeCocoJsonVariant */ 1, /* writeImages */ "", /* writeImagesFormat */ "png",
                /* writeVideo */ "", /* writeVideoFps */ 30.0, /* writeVideoWithAudio */ false,
                /* writeHeatMaps */ "", /* writeHeatMapsFormat */ "png", /* writeVideo3D */ "",
                /* writeVideoAdam */ "", /* writeBvh */ "", /* udpHost */ "", /* udpPort */ "8051");

            OPWrapper.OPConfigureGui(
                /* displayMode */ DisplayMode.NoDisplay, /* guiVerbose */ false, /* fullScreen */ false);

            OPWrapper.OPConfigureDebugging(
                /* loggingLevel */ Priority.High, /* disableMultiThread */ false, /* profileSpeed */ 1000);
        }
Exemplo n.º 2
0
        // User can change the settings here
        private void UserConfigureOpenPose()
        {
            OPWrapper.OPConfigurePose(
                /* body_disable */ false, /* net_resolution */ netResolution, /* output_resolution */ null,
                /* keypoint_scale_mode */ ScaleMode.InputResolution,
                /* num_gpu */ -1, /* num_gpu_start */ 0, /* scale_number */ 1, /* scale_gap */ 0.3f,
                /* pose_render_mode */ RenderMode.Gpu, /* model_pose */ PoseModel.BODY_25,
                /* disable_blending */ false, /* alpha_pose */ 0.6f, /* alpha_heatmap */ 0.7f,
                /*t part_to_show */ 0, /* model_folder */ null,
                /* heatmap_type */ HeatMapType.None, /* heatmap_scale_mode */ ScaleMode.UnsignedChar,
                /* part_candidates */ false, /* render_threshold */ renderThreshold, /* number_people_max */ maxPeople);

            OPWrapper.OPConfigureHand(
                /* hand */ handEnabled, /* hand_net_resolution */ handResolution,
                /* hand_scale_number */ 1, /* hand_scale_range */ 0.4f, /* hand_tracking */ false,
                /* hand_render_mode */ RenderMode.None,
                /* hand_alpha_pose */ 0.6f, /* hand_alpha_heatmap */ 0.7f, /* hand_render_threshold */ 0.2f);

            OPWrapper.OPConfigureFace(
                /* face */ faceEnabled, /* face_net_resolution */ faceResolution,
                /* face_render_mode */ RenderMode.None,
                /* face_alpha_pose */ 0.6f, /* face_alpha_heatmap */ 0.7f, /* face_render_threshold */ 0.4f);

            OPWrapper.OPConfigureExtra(
                /* _3d */ false, /* _3d_min_views */ -1, /* _identification */ false, /* _tracking */ -1, /* _ik_threads */ 0);

            OPWrapper.OPConfigureInput(
                /* producer_type */ inputType, /* producer_string */ producerString,
                /* frame_first */ 0, /* frame_step */ 1, /* frame_last */ ulong.MaxValue,
                /* process_real_time */ false, /* frame_flip */ false,
                /* frame_rotate */ 0, /* frames_repeat */ false,
                /* camera_resolution */ null, /* camera_parameter_path */ null,
                /* undistort_image */ true, /* image_directory_stereo */ 1);

            OPWrapper.OPConfigureOutput(
                /* verbose */ -1.0, /* write_keypoint */ "", /* write_keypoint_format */ DataFormat.Yml,
                /* write_json */ "", /* write_coco_json */ "", /* write_coco_foot_json */ "", /* write_coco_json_variant */ 1,
                /* write_images */ "", /* write_images_format */ "png", /* write_video */ "",
                /* camera_fps */ 30.0, /* write_heatmaps */ "", /* write_heatmaps_format */ "png",
                /* write_video_adam */ "", /* write_bvh */ "", /* udp_host */ "", /* udp_port */ "8051");

            OPWrapper.OPConfigureGui(
                /* display_mode */ DisplayMode.NoDisplay,
                /* gui_verbose */ false, /* full_screen */ false);
        }