Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,6 +96,7 @@ def create_img1(imagep, text_overlay, color):
|
|
| 96 |
s3_client.download_file('inpaintingnitin', 'D1/2.jpg', '2.jpg')
|
| 97 |
s3_client.download_file('inpaintingnitin', 'D1/3.jpg', '3.jpg')
|
| 98 |
s3_client.download_file('inpaintingnitin', 'D1/Screenshot 2023-08-25 at 2.30.38 PM.png', 'img.png')
|
|
|
|
| 99 |
|
| 100 |
image_path = 'img.png'
|
| 101 |
image = cv2.imread(image_path)
|
|
@@ -172,7 +173,7 @@ def create_img1(imagep, text_overlay, color):
|
|
| 172 |
output_image_path = 'output_image.jpg'
|
| 173 |
cv2.imwrite(output_image_path, overlay)
|
| 174 |
|
| 175 |
-
img = text_to_image(add_line_breaks(text_overlay, 13),"
|
| 176 |
img.save("outputtext.png", format="PNG")
|
| 177 |
|
| 178 |
text = cv2.imread('/content/outputtext.png',cv2.IMREAD_UNCHANGED)
|
|
@@ -195,6 +196,7 @@ def create_img2(imagep, text_overlay, color):
|
|
| 195 |
s3_client.download_file('inpaintingnitin', 'D2/2.jpg', '2.jpg')
|
| 196 |
s3_client.download_file('inpaintingnitin', 'D2/3.jpg', '3.jpg')
|
| 197 |
s3_client.download_file('inpaintingnitin', 'D2/Screenshot 2023-08-25 at 2.32.07 PM copy.jpg', 'img.jpg')
|
|
|
|
| 198 |
|
| 199 |
|
| 200 |
image_path = 'img.jpg'
|
|
@@ -272,7 +274,7 @@ def create_img2(imagep, text_overlay, color):
|
|
| 272 |
output_image_path = 'output_image.jpg'
|
| 273 |
cv2.imwrite(output_image_path, overlay)
|
| 274 |
|
| 275 |
-
img = text_to_image(add_line_breaks(text_overlay, 13),"
|
| 276 |
img.save("outputtext.png", format="PNG")
|
| 277 |
|
| 278 |
text = cv2.imread('/content/outputtext.png',cv2.IMREAD_UNCHANGED)
|
|
|
|
| 96 |
s3_client.download_file('inpaintingnitin', 'D1/2.jpg', '2.jpg')
|
| 97 |
s3_client.download_file('inpaintingnitin', 'D1/3.jpg', '3.jpg')
|
| 98 |
s3_client.download_file('inpaintingnitin', 'D1/Screenshot 2023-08-25 at 2.30.38 PM.png', 'img.png')
|
| 99 |
+
s3_client.download_file('inpaintingnitin', 'Poppins-Medium.ttf', 'Poppins-Medium.ttf')
|
| 100 |
|
| 101 |
image_path = 'img.png'
|
| 102 |
image = cv2.imread(image_path)
|
|
|
|
| 173 |
output_image_path = 'output_image.jpg'
|
| 174 |
cv2.imwrite(output_image_path, overlay)
|
| 175 |
|
| 176 |
+
img = text_to_image(add_line_breaks(text_overlay, 13),"Poppins-Medium.ttf",100,color[8] )
|
| 177 |
img.save("outputtext.png", format="PNG")
|
| 178 |
|
| 179 |
text = cv2.imread('/content/outputtext.png',cv2.IMREAD_UNCHANGED)
|
|
|
|
| 196 |
s3_client.download_file('inpaintingnitin', 'D2/2.jpg', '2.jpg')
|
| 197 |
s3_client.download_file('inpaintingnitin', 'D2/3.jpg', '3.jpg')
|
| 198 |
s3_client.download_file('inpaintingnitin', 'D2/Screenshot 2023-08-25 at 2.32.07 PM copy.jpg', 'img.jpg')
|
| 199 |
+
s3_client.download_file('inpaintingnitin', 'Poppins-Medium.ttf', 'Poppins-Medium.ttf')
|
| 200 |
|
| 201 |
|
| 202 |
image_path = 'img.jpg'
|
|
|
|
| 274 |
output_image_path = 'output_image.jpg'
|
| 275 |
cv2.imwrite(output_image_path, overlay)
|
| 276 |
|
| 277 |
+
img = text_to_image(add_line_breaks(text_overlay, 13),"Poppins-Medium.ttf",100,color[1] )
|
| 278 |
img.save("outputtext.png", format="PNG")
|
| 279 |
|
| 280 |
text = cv2.imread('/content/outputtext.png',cv2.IMREAD_UNCHANGED)
|