MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / imssave

Function imssave

ldm/modules/image_degradation/utils_image.py:112–122  ·  view source on GitHub ↗

imgs: list, N images of size WxHxC

(imgs, img_path)

Source from the content-addressed store, hash-verified

110
111
112def imssave(imgs, img_path):
113 """
114 imgs: list, N images of size WxHxC
115 """
116 img_name, ext = os.path.splitext(os.path.basename(img_path))
117
118 for i, img in enumerate(imgs):
119 if img.ndim == 3:
120 img = img[:, :, [2, 1, 0]]
121 new_path = os.path.join(os.path.dirname(img_path), img_name+str('_s{:04d}'.format(i))+'.png')
122 cv2.imwrite(new_path, img)
123
124
125def split_imageset(original_dataroot, taget_dataroot, n_channels=3, p_size=800, p_overlap=96, p_max=1000):

Callers 1

split_imagesetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected