mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-02-21 00:44:46 +08:00
init
This commit is contained in:
14
backend/inpaint/utils/visualize_bbox.py
Normal file
14
backend/inpaint/utils/visualize_bbox.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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')
|
||||
Reference in New Issue
Block a user