File size: 381 Bytes
9e14838 | 1 2 3 4 5 6 7 8 9 10 11 12 | # -*- coding: utf-8 -*-
import numpy as np
def _get_pixels(per_pixel, rand_color, patch_size, dtype=np.float32):
if per_pixel:
return np.random.randint(0, 255, patch_size).astype(dtype=dtype)
elif rand_color:
return np.random.randint(0, 255, (1, 1, patch_size[2])).astype(dtype=dtype)
else:
return np.zeros((1, 1, patch_size[2]), dtype=dtype)
|