0

媒体管道爱好者!

我不得不说,Mediapipe 拥有最好的视觉框架之一,可以检测身体姿势、面部表情、手部跟踪动作等特征。然而,媒体管道检测灵敏度非常高,尤其是在检测手时。很多时候,它会将我的脸或周围环境检测为手部特征。

根据此文档https://google.github.io/mediapipe/solutions/hands.html#min_detection_confidence,可以选择设置置信度。

我尝试将 HandTrackerViewController.mm 中的配置设置为 0.9,如下所示,但我看不出与默认配置 0.5 有显着差异。我做得对吗?

static const char* kLandmarksOutputStream = "hand_landmarks";
static const char* kNumHandsInputSidePacket = "num_hands";
static const char* kMinDetectionConfidence = "min_detection_confidence";
static const char* kMinTrackingConfidence = "min_tracking_confidence";

// Max number of hands to detect/process.
static const int kNumHands = 2;
static const int kMinDetection = 0.9;
static const int kMinTracking = 0.9;

@implementation HandTrackingViewController

#pragma mark - UIViewController methods

- (void)viewDidLoad {
  [super viewDidLoad];

    [self.mediapipeGraph setSidePacket:(mediapipe::MakePacket<int>(kNumHands))
                               named:kNumHandsInputSidePacket];
    
    //Setting of minimum detection confidence level
    [self.mediapipeGraph setSidePacket:(mediapipe::MakePacket<int>(kMinDetection))
                               named:kMinDetectionConfidence];
    
    //Setting of minimum tracking confidence level
    [self.mediapipeGraph setSidePacket:(mediapipe::MakePacket<int>(kMinTracking))
                               named:kMinTrackingConfidence];
    
    
    [self.mediapipeGraph addFrameOutputStream:kLandmarksOutputStream
                             outputPacketType:MPPPacketTypeRaw];
}

谢谢!

4

0 回答 0