Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -211,11 +211,19 @@ def blur_im(img,bounds):
|
|
| 211 |
kernel = np.ones((5, 5), np.uint8)
|
| 212 |
im[y:y+h, x:x+w] = cv2.dilate(im[y:y+h, x:x+w], kernel, iterations=2)
|
| 213 |
im[y:y+h, x:x+w] = cv2.GaussianBlur(im[y:y+h, x:x+w],(51,51),0)
|
|
|
|
|
|
|
| 214 |
#fontpath = "tamil/Latha.ttf"
|
| 215 |
text = "New Text"
|
| 216 |
|
| 217 |
#font = ImageFont.truetype(fontpath, 32)
|
| 218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
draw = ImageDraw.Draw(im)
|
| 220 |
draw.text((x+5, y+5),text, font = None)
|
| 221 |
#img_tamil = np.array(img_pil)
|
|
|
|
| 211 |
kernel = np.ones((5, 5), np.uint8)
|
| 212 |
im[y:y+h, x:x+w] = cv2.dilate(im[y:y+h, x:x+w], kernel, iterations=2)
|
| 213 |
im[y:y+h, x:x+w] = cv2.GaussianBlur(im[y:y+h, x:x+w],(51,51),0)
|
| 214 |
+
|
| 215 |
+
|
| 216 |
#fontpath = "tamil/Latha.ttf"
|
| 217 |
text = "New Text"
|
| 218 |
|
| 219 |
#font = ImageFont.truetype(fontpath, 32)
|
| 220 |
+
im = Image.fromarray(im)
|
| 221 |
+
for bound in bounds:
|
| 222 |
+
p0, p1, p2, p3 = bound[0]
|
| 223 |
+
x = int(p0[0])
|
| 224 |
+
y = int(p0[1])
|
| 225 |
+
w = int(p2[0]) - int(x)
|
| 226 |
+
h = int(p2[1]) - int(y)
|
| 227 |
draw = ImageDraw.Draw(im)
|
| 228 |
draw.text((x+5, y+5),text, font = None)
|
| 229 |
#img_tamil = np.array(img_pil)
|