tub.py 文件源码

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

项目:donkey 作者: wroscoe 项目源码 文件源码
def clips_of_tub(self, tub_path):
        seqs = [ int(f.split("_")[0]) for f in os.listdir(tub_path) if f.endswith('.jpg') ]
        seqs.sort()

        entries = ((os.stat(self.image_path(tub_path, seq))[ST_ATIME], seq) for seq in seqs)

        (last_ts, seq) = next(entries)
        clips = [[seq]]
        for next_ts, next_seq in entries:
            if next_ts - last_ts > 100:  #greater than 1s apart
                clips.append([next_seq])
            else:
                clips[-1].append(next_seq)
            last_ts = next_ts

        return clips
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号