Spaces:
Runtime error
Runtime error
Download utils/visualize_bbox.py from TDN-M/Inpaint-Anything: direct link, hf CLI and curl.
- Browser
- Download file 388 Bytes
-
https://huggingface.co/spaces/TDN-M/Inpaint-Anything/resolve/main/utils/visualize_bbox.py
- Command line
-
hf download hf://spaces/TDN-M/Inpaint-Anything/utils/visualize_bbox.py
-
curl -L -o visualize_bbox.py https://huggingface.co/spaces/TDN-M/Inpaint-Anything/resolve/main/utils/visualize_bbox.py
388 Bytes
| import matplotlib.pyplot as plt | |
| import matplotlib.patches as patches | |
| import numpy as np | |
| import cv2 | |
| img = plt.imread('../example/fill-anything/sample1.png') | |
| fig, ax = plt.subplots(1) | |
| ax.imshow(img) | |
| x1, y1, x2, y2 = 230, 283, 352, 407 | |
| rect = patches.Rectangle((x1, y1), x2-x1, y2-y1, linewidth=2, edgecolor='r', facecolor='none') | |
| ax.add_patch(rect) | |
| plt.savefig('bbox.png') | |