extract_tiles.py 文件源码

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

项目:vae-style-transfer 作者: sunsided 项目源码 文件源码
def load_images(queue: PriorityQueue,
                source: int,
                file_path: str,
                target_width: int,
                target_height: int,
                display_progress: bool=False):
    window = 'image'
    if display_progress:
        cv2.namedWindow(window)

    for file in iglob(path.join(file_path, '**', '*.jpg'), recursive=True):
        buffer = cv2.imread(file)
        buffer = cv2.resize(buffer, (target_width, target_height), interpolation=cv2.INTER_AREA)

        random_priority = random()
        queue.put((random_priority, (buffer, source)))

        if display_progress:
            cv2.imshow(window, buffer)
            if (cv2.waitKey(33) & 0xff) == 27:
                break

    if display_progress:
        cv2.destroyWindow(window)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号