Spaces:
Sleeping
Sleeping
wjbmattingly
commited on
Commit
•
4f7c6a7
1
Parent(s):
e577f0c
Update app.py
Browse files
app.py
CHANGED
@@ -100,22 +100,33 @@ def run_example(image):
|
|
100 |
|
101 |
return output_image
|
102 |
css = """
|
103 |
-
|
104 |
-
height:
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
"""
|
|
|
109 |
with gr.Blocks(css=css) as demo:
|
110 |
gr.Markdown(TITLE)
|
111 |
gr.Markdown(DESCRIPTION)
|
112 |
with gr.Tab(label="Florence-2 Image Processing"):
|
113 |
with gr.Row():
|
114 |
-
with gr.Column():
|
115 |
-
input_img = gr.Image(label="Input Picture")
|
116 |
submit_btn = gr.Button(value="Submit")
|
117 |
-
with gr.Column():
|
118 |
-
output_img = gr.Image(label="Output Image with Bounding Boxes")
|
|
|
119 |
gr.Examples(
|
120 |
examples=[
|
121 |
["https://huggingface.co/datasets/CATMuS/medieval-segmentation/resolve/main/data/train/cambridge-corpus-christi-college-ms-111/page-002-of-003.jpg"],
|
|
|
100 |
|
101 |
return output_image
|
102 |
css = """
|
103 |
+
#output_img {
|
104 |
+
height: 600px;
|
105 |
+
width: 100%;
|
106 |
+
object-fit: contain;
|
107 |
+
}
|
108 |
+
#input_img {
|
109 |
+
max-width: 150px;
|
110 |
+
max-height: 150px;
|
111 |
+
object-fit: cover;
|
112 |
+
cursor: pointer;
|
113 |
+
}
|
114 |
+
#input_img img:hover {
|
115 |
+
opacity: 0.8;
|
116 |
+
}
|
117 |
"""
|
118 |
+
|
119 |
with gr.Blocks(css=css) as demo:
|
120 |
gr.Markdown(TITLE)
|
121 |
gr.Markdown(DESCRIPTION)
|
122 |
with gr.Tab(label="Florence-2 Image Processing"):
|
123 |
with gr.Row():
|
124 |
+
with gr.Column(scale=1):
|
125 |
+
input_img = gr.Image(label="Input Picture (click to expand)", elem_id="input_img")
|
126 |
submit_btn = gr.Button(value="Submit")
|
127 |
+
with gr.Column(scale=3):
|
128 |
+
output_img = gr.Image(label="Output Image with Bounding Boxes", elem_id="output_img")
|
129 |
+
|
130 |
gr.Examples(
|
131 |
examples=[
|
132 |
["https://huggingface.co/datasets/CATMuS/medieval-segmentation/resolve/main/data/train/cambridge-corpus-christi-college-ms-111/page-002-of-003.jpg"],
|