Spaces:
Running
Running
fcakyon
commited on
Commit
·
6ded5e1
1
Parent(s):
4c15790
some debug commit
Browse files
app.py
CHANGED
|
@@ -216,7 +216,7 @@ if submit:
|
|
| 216 |
)
|
| 217 |
|
| 218 |
st.markdown(f"##### YOLOX Standard vs SAHI Prediction:")
|
| 219 |
-
static_component, image_1_path, image_2_path = imagecompare(
|
| 220 |
output_1,
|
| 221 |
output_2,
|
| 222 |
label1="YOLOX",
|
|
@@ -226,7 +226,7 @@ if submit:
|
|
| 226 |
show_labels=True,
|
| 227 |
make_responsive=True,
|
| 228 |
)
|
| 229 |
-
st.
|
| 230 |
-
st.write(
|
| 231 |
st.write(pathlib.Path(image_1_path).exists())
|
| 232 |
st.image(Image.open(image_1_path))
|
|
|
|
| 216 |
)
|
| 217 |
|
| 218 |
st.markdown(f"##### YOLOX Standard vs SAHI Prediction:")
|
| 219 |
+
static_component, image_1_path, image_2_path, htmlcode = imagecompare(
|
| 220 |
output_1,
|
| 221 |
output_2,
|
| 222 |
label1="YOLOX",
|
|
|
|
| 226 |
show_labels=True,
|
| 227 |
make_responsive=True,
|
| 228 |
)
|
| 229 |
+
st.markdown(htmlcode, unsafe_allow_html=True)
|
| 230 |
+
st.write(htmlcode)
|
| 231 |
st.write(pathlib.Path(image_1_path).exists())
|
| 232 |
st.image(Image.open(image_1_path))
|
utils.py
CHANGED
|
@@ -108,6 +108,9 @@ def imagecompare(
|
|
| 108 |
image_2_path = str(image_2_path.resolve())
|
| 109 |
sahi.utils.cv.read_image_as_pil(img2).save(image_2_path)
|
| 110 |
|
|
|
|
|
|
|
|
|
|
| 111 |
img_width, img_height = img1.size
|
| 112 |
h_to_w = img_height / img_width
|
| 113 |
height = width * h_to_w - 20
|
|
@@ -145,4 +148,4 @@ def imagecompare(
|
|
| 145 |
"""
|
| 146 |
static_component = components.html(htmlcode, height=height, width=width)
|
| 147 |
|
| 148 |
-
return static_component, image_1_path, image_2_path
|
|
|
|
| 108 |
image_2_path = str(image_2_path.resolve())
|
| 109 |
sahi.utils.cv.read_image_as_pil(img2).save(image_2_path)
|
| 110 |
|
| 111 |
+
image_1_name = "https://juxtapose.knightlab.com/static/img/Sochi_11April2005.jpg"
|
| 112 |
+
image_2_name = "https://juxtapose.knightlab.com/static/img/Sochi_22Nov2013.jpg"
|
| 113 |
+
|
| 114 |
img_width, img_height = img1.size
|
| 115 |
h_to_w = img_height / img_width
|
| 116 |
height = width * h_to_w - 20
|
|
|
|
| 148 |
"""
|
| 149 |
static_component = components.html(htmlcode, height=height, width=width)
|
| 150 |
|
| 151 |
+
return static_component, image_1_path, image_2_path, htmlcode
|