Skip to content

Latest commit

 

History

History

HandsEstimation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

OpenPose HandsEstimation的推理部署

效果展示

输入图像 输出图像

预训练推理模型下载

代码示例

# main.py
from ppqi import InferenceModel
from processor import preprocess, postprocess

# 参数配置
configs = {
    'img_path': 'test.jpg',
    'save_dir': 'save_img',
    'model_name': 'openpose_hands_estimation',
    'use_gpu': False,
    'use_mkldnn': False,
    'threshold': 0.1
}

# 第一步:数据预处理
input_data = preprocess(
    configs['img_path']
)

# 第二步:加载模型
model = InferenceModel(
    modelpath=configs['model_name'], 
    use_gpu=configs['use_gpu'], 
    use_mkldnn=configs['use_mkldnn']
)
model.eval()

# 第三步:模型推理
output = model(input_data)

# 第四步:结果后处理
postprocess(
    output, 
    configs['save_dir'],
    configs['img_path'],
    configs['model_name'],
    configs['threshold']
)