當前位置: 首頁>>代碼示例>>Python>>正文


Python inference.get_final_preds方法代碼示例

本文整理匯總了Python中core.inference.get_final_preds方法的典型用法代碼示例。如果您正苦於以下問題:Python inference.get_final_preds方法的具體用法?Python inference.get_final_preds怎麽用?Python inference.get_final_preds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core.inference的用法示例。


在下文中一共展示了inference.get_final_preds方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_keypoints_from_bbox

# 需要導入模塊: from core import inference [as 別名]
# 或者: from core.inference import get_final_preds [as 別名]
def get_keypoints_from_bbox(pose_model, image, bbox):
    x1,y1,w,h = bbox
    bbox_input = []
    bbox_input.append([x1, y1, x1+w, y1+h])
    inputs, origin_img, center, scale = pre_process(image, bbox_input, scores=1, cfg=cfg)
    with torch.no_grad():
        # compute output heatmap
        inputs = inputs[:,[2,1,0]]
        output = pose_model(inputs.cuda())
        # compute coordinate
        preds, maxvals = get_final_preds(
            cfg, output.clone().cpu().numpy(), np.asarray(center), np.asarray(scale))

    # (N, 17, 3)
    result = np.concatenate((preds, maxvals), -1)
    return result 
開發者ID:lxy5513,項目名稱:cvToolkit,代碼行數:18,代碼來源:pose_estimation.py

示例2: get_keypoints

# 需要導入模塊: from core import inference [as 別名]
# 或者: from core.inference import get_final_preds [as 別名]
def get_keypoints(human_model, pose_model, image, smooth=None):
    bboxs, scores = yolo_infrence(image, human_model)
    # bbox is coordinate location
    inputs, origin_img, center, scale = pre_process(image, bboxs, scores, cfg)

    with torch.no_grad():
        # compute output heatmap
        inputs = inputs[:,[2,1,0]]
        output = pose_model(inputs.cuda())
        # compute coordinate
        preds, maxvals = get_final_preds(
            cfg, output.clone().cpu().numpy(), np.asarray(center), np.asarray(scale))

    # (N, 17, 3)
    result = np.concatenate((preds, maxvals), -1)
    return result 
開發者ID:lxy5513,項目名稱:cvToolkit,代碼行數:18,代碼來源:pose_estimation.py

示例3: get_keypoints_from_bbox

# 需要導入模塊: from core import inference [as 別名]
# 或者: from core.inference import get_final_preds [as 別名]
def get_keypoints_from_bbox(pose_model, image, bbox):
    x1,y1,w,h = bbox
    bbox_input = []
    bbox_input.append([x1, y1, x1+w, y1+h])
    inputs, origin_img, center, scale = pre_process(image, bbox_input, scores=1, cfg=config)
    with torch.no_grad():
        # compute output heatmap
        output = pose_model(inputs.cuda())
        # compute coordinate
        preds, maxvals = get_final_preds(
            config, output.clone().cpu().numpy(), np.asarray(center), np.asarray(scale))

    # (N, 17, 3)
    result = np.concatenate((preds, maxvals), -1)
    return result 
開發者ID:lxy5513,項目名稱:cvToolkit,代碼行數:17,代碼來源:pose_estimation.py

示例4: get_keypoints

# 需要導入模塊: from core import inference [as 別名]
# 或者: from core.inference import get_final_preds [as 別名]
def get_keypoints(human_model, pose_model, image):
    bboxs, scores = yolo_infrence(image, human_model)
    # bbox is coordinate location
    inputs, origin_img, center, scale = pre_process(image, bboxs, scores, config)

    with torch.no_grad():
        # compute output heatmap
        output = pose_model(inputs.cuda())
        # compute coordinate
        preds, maxvals = get_final_preds(
            config, output.clone().cpu().numpy(), np.asarray(center), np.asarray(scale))

    # (N, 17, 3)
    result = np.concatenate((preds, maxvals), -1)
    return result 
開發者ID:lxy5513,項目名稱:cvToolkit,代碼行數:17,代碼來源:pose_estimation.py


注:本文中的core.inference.get_final_preds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。