ingest.py 文件源码

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

项目:esper 作者: scanner-research 项目源码 文件源码
def make_thumbnail(video, db):
    indices = [int(n * video.num_frames) for n in [0.1, 0.35, 0.60, 0.85]]
    table = db.table(video.path)
    frames = [f[0] for _, f in table.load([1], rows=indices)]
    img = make_montage(len(frames), iter(frames), frame_width=150, frames_per_row=2)
    run('mkdir -p assets/thumbnails')
    cv2.imwrite('assets/thumbnails/{}.jpg'.format(video.id), cv2.cvtColor(img, cv2.COLOR_RGB2BGR))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号