def METHOD_NAME(self, img_data):
    if not isinstance(img_data, Image):
        img_data = Image(img_data)
    img_data = img_data.convert(format='channels_last', channel_order='rgb')
    self.predictor = DefaultPredictor(self.cfg)
    self.cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = self.threshold
    output = self.predictor(img_data)
    bounding_box = output["instances"].to("cpu").pred_boxes.tensor.numpy()
    keypoints_pred = output["instances"].to("cpu").pred_keypoints.numpy()
    if len(bounding_box) > 0:
        return 1, bounding_box[0], keypoints_pred[0]
    else:
        return 0, None, None