Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_images():
data = imgviz.data.arc2017()
yield data["rgb"]
yield imgviz.depth2rgb(data["depth"], min_value=0.3, max_value=1)
yield imgviz.label2rgb(data["class_label"])
def depth2rgb():
data = imgviz.data.arc2017()
depthviz = imgviz.depth2rgb(data["depth"], min_value=0.3, max_value=1)
# -------------------------------------------------------------------------
plt.figure(dpi=200)
plt.subplot(121)
plt.title("rgb")
plt.imshow(data["rgb"])
plt.axis("off")
plt.subplot(122)
plt.title("depth (colorized)")
plt.imshow(depthviz)
plt.axis("off")
def tile():
data = imgviz.data.arc2017()
rgb = data["rgb"]
bboxes = data["bboxes"].astype(int)
masks = data["masks"] == 1
crops = []
for bbox, mask in zip(bboxes, masks):
slice_ = slice(bbox[0], bbox[2]), slice(bbox[1], bbox[3])
rgb_crop = rgb[slice_]
mask_crop = mask[slice_]
crops.append(rgb_crop * mask_crop[:, :, None])
tiled = imgviz.tile(imgs=crops, border=(255, 255, 255))
# -------------------------------------------------------------------------
plt.figure(dpi=200)