Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,15 +29,13 @@ def pdf_to_img(pdf_path):
|
|
| 29 |
def concate_image(img_input):
|
| 30 |
img_name_lst = img_input.split(',')
|
| 31 |
if len(img_name_lst) == 1 :
|
| 32 |
-
|
| 33 |
-
img2 = cv2.imread(img_name_lst[0])
|
| 34 |
-
im_v = cv2.vconcat([img1, img2])
|
| 35 |
else:
|
| 36 |
img1 = cv2.imread(img_name_lst[0])
|
| 37 |
img2 = cv2.imread(img_name_lst[1])
|
| 38 |
im_v = cv2.vconcat([img1, img2])
|
| 39 |
-
|
| 40 |
-
|
| 41 |
|
| 42 |
# def encode_image(image_path):
|
| 43 |
# file_path = concate_image(image_path)
|
|
@@ -107,8 +105,8 @@ with block:
|
|
| 107 |
with gr.Row():
|
| 108 |
with gr.Column():
|
| 109 |
image_name = gr.Textbox(label="""
|
| 110 |
-
Provide the
|
| 111 |
-
|
| 112 |
""")
|
| 113 |
show_button = gr.Button(value="Show Images")
|
| 114 |
output_img = gr.Image(type="filepath")
|
|
|
|
| 29 |
def concate_image(img_input):
|
| 30 |
img_name_lst = img_input.split(',')
|
| 31 |
if len(img_name_lst) == 1 :
|
| 32 |
+
return img_name_lst[0]
|
|
|
|
|
|
|
| 33 |
else:
|
| 34 |
img1 = cv2.imread(img_name_lst[0])
|
| 35 |
img2 = cv2.imread(img_name_lst[1])
|
| 36 |
im_v = cv2.vconcat([img1, img2])
|
| 37 |
+
cv2.imwrite('merge_image.jpg', im_v)
|
| 38 |
+
return "merge_image.jpg"
|
| 39 |
|
| 40 |
# def encode_image(image_path):
|
| 41 |
# file_path = concate_image(image_path)
|
|
|
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
| 107 |
image_name = gr.Textbox(label="""
|
| 108 |
+
Note: Provide the name of the images to be compared separated by a comma(,),
|
| 109 |
+
|
| 110 |
""")
|
| 111 |
show_button = gr.Button(value="Show Images")
|
| 112 |
output_img = gr.Image(type="filepath")
|