chunkdataprovider.py 文件源码

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

项目:pytorch_fnet 作者: AllenCellModeling 项目源码 文件源码
def _augment_chunks(self, chunks):
        if self.choices_augmentation is None:
            return chunks
        chunks_new = []
        choice = np.random.choice(self.choices_augmentation)
        for chunk in chunks:
            chunk_new = chunk
            if choice in [1, 3, 5, 7]:
                chunk_new = np.flip(chunk_new, axis=1)
            if   choice in [2, 3]:
                chunk_new = np.rot90(chunk_new, 1, axes=(1, 2))
            elif choice in [4, 5]:
                chunk_new = np.rot90(chunk_new, 2, axes=(1, 2))
            elif choice in [6, 7]:
                chunk_new = np.rot90(chunk_new, 3, axes=(1, 2))
            chunks_new.append(chunk_new)
        return chunks_new
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号