added smooth landmarks support
This commit is contained in:
parent
65a944e3f9
commit
c9670669b2
|
@ -275,6 +275,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
.setStaticImageMode(false)
|
||||
.setLandmarkVisibility(true)
|
||||
.setModelComplexity(0)
|
||||
.setSmoothLandmarks(true)
|
||||
.build());
|
||||
poseTracking.setErrorListener(
|
||||
(message, e) -> Log.e(TAG, "MediaPipe Face Detection error:" + message));
|
||||
|
|
|
@ -63,6 +63,7 @@ node {
|
|||
calculator: "PoseLandmarkGpu"
|
||||
input_side_packet: "ENABLE_SEGMENTATION:enable_segmentation"
|
||||
input_side_packet: "MODEL_COMPLEXITY:model_complexity"
|
||||
input_side_packet: "SMOOTH_LANDMARKS:smooth_landmarks"
|
||||
input_stream: "IMAGE:throttled_input_video"
|
||||
output_stream: "LANDMARKS:pose_landmarks"
|
||||
output_stream: "SEGMENTATION_MASK:segmentation_mask"
|
||||
|
|
|
@ -128,6 +128,7 @@ public class PoseTracking extends ImageSolutionBase {
|
|||
Map<String, Packet> inputSidePackets = new HashMap<>();
|
||||
// inputSidePackets.put("enable_segmentation", packetCreator.createBool(false));
|
||||
inputSidePackets.put("model_complexity",packetCreator.createInt32(options.modelComplexity()));
|
||||
inputSidePackets.put("smooth_landmarks",packetCreator.createBool(options.smoothLandmarks()));
|
||||
start(inputSidePackets);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ public abstract class PoseTrackingOptions {
|
|||
|
||||
public abstract boolean landmarkVisibility();
|
||||
|
||||
public abstract boolean smoothLandmarks();
|
||||
|
||||
public static Builder builder() {
|
||||
return new AutoValue_PoseTrackingOptions.Builder().withDefaultValues();
|
||||
}
|
||||
|
@ -49,7 +51,10 @@ public abstract class PoseTrackingOptions {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
public Builder withDefaultValues() {
|
||||
return setStaticImageMode(false).setModelComplexity(0).setMinDetectionConfidence(0.5f);
|
||||
return setStaticImageMode(false)
|
||||
.setModelComplexity(0)
|
||||
.setMinDetectionConfidence(0.5f)
|
||||
.setSmoothLandmarks(true);
|
||||
}
|
||||
|
||||
public abstract Builder setStaticImageMode(boolean value);
|
||||
|
@ -60,6 +65,7 @@ public abstract class PoseTrackingOptions {
|
|||
|
||||
public abstract Builder setLandmarkVisibility(boolean value);
|
||||
|
||||
public abstract Builder setSmoothLandmarks(boolean value);
|
||||
public abstract PoseTrackingOptions build();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user