webcan.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:pose-regression 作者: dluvizon 项目源码 文件源码
def main_thread():

    # Build the model and load the pre-trained weights on MPII
    model = posereg.build(input_shape, pa16j.num_joints, export_heatmaps=True)
    weights_path = get_file(weights_file, TF_WEIGHTS_PATH, md5_hash=md5_hash,
            cache_subdir=cache_subdir)
    model.load_weights(weights_path)

    queue_frames = queue.Queue(2)
    queue_poses = queue.Queue(2)
    proc = threading.Thread(target=thread_grab_frames,
            args=(queue_frames, queue_poses))
    proc.daemon = True
    proc.start()

    clock = pygame.time.Clock()

    show_fps_cnt = 0
    while True:
        x = queue_frames.get()
        pred = model.predict(x)
        pred.append(x) # Append the input frame
        queue_poses.put(pred)

        clock.tick()
        show_fps_cnt += 1
        if show_fps_cnt == 10:
            show_fps_cnt = 0
            print ('fps: ' + str(clock.get_fps()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号