我正在尝试通过 keras 实现来使用人体姿势估计。我正在使用这个来源https://github.com/michalfaber/keras_Realtime_Multi-Person_Pose_Estimation。我的问题是如何生成下图的骨架视图,左侧的那个?但是,我可以在右侧生成一个。
下面是我用来实现这一点的代码。
# vgg normalization (subtracting mean) on input images
model = get_testing_model()
model.load_weights(keras_weights_file)
# load config
params, model_params = config_reader()
input_image = cv2.imread(image_path) # B,G,R order
body_parts, all_peaks, subset, candidate = extract_parts(input_image, params, model, model_params)
canvas = draw(input_image, all_peaks, subset, candidate)
toc = time.time()
print('processing time is %.5f' % (toc - tic))
cv2.imwrite(output, canvas)
cv2.destroyAllWindows()