def __init__(self, src_root, dst_root, grayscale, size): ''' Args: src_root: Source root directory dst_root: Target root directory. This will always be created. resize: tuple of the new x and y size. ''' self.tree_util = TreeUtil(src_root, dst_root) converter = ImageCounter(src_root, src_root) converter.process() img_cnt = converter.get_count() self._size = size self._grayscale = grayscale self._color_layers = 1 if not self._grayscale: self._color_layers = 3 self._img = np.zeros([img_cnt, size[0] * size[1] * self._color_layers], dtype=np.uint8) self._label = np.zeros([img_cnt, 3], dtype=np.float32) self._idx = 0 self._filename_manager = FilenameManager()
def __init__(self, src_root, dst_root): ''' Args: src_root: Source root directory dst_root: Target root directory. This will always be created. ''' self.tree_util = TreeUtil(src_root, dst_root) self._count = 0
def __init__(self, src_root, dst_root, grayscale=False, resize=None): ''' Args: src_root: Source root directory dst_root: Target root directory. This will always be created. resize: tuple of the new x and y size. ''' self.tree_util = TreeUtil(src_root, dst_root) self._resize = resize self._grayscale = grayscale
def __init__(self, src_path, pattern, theta_step, span_step, span_count, fmt): self._filenames = [] self._src_path = src_path self._dst_path = '.' self._pattern = pattern self._theta_step = theta_step self._span_step = span_step self._span_count = span_count self._fmt = fmt self._tree_util = TreeUtil(self._src_path, self._dst_path)