Spaces:
Running
Running
fcakyon
commited on
Commit
·
4d223e5
1
Parent(s):
6ded5e1
debug commit
Browse files
app.py
CHANGED
@@ -226,7 +226,8 @@ if submit:
|
|
226 |
show_labels=True,
|
227 |
make_responsive=True,
|
228 |
)
|
229 |
-
|
230 |
st.write(htmlcode)
|
231 |
st.write(pathlib.Path(image_1_path).exists())
|
|
|
232 |
st.image(Image.open(image_1_path))
|
|
|
226 |
show_labels=True,
|
227 |
make_responsive=True,
|
228 |
)
|
229 |
+
|
230 |
st.write(htmlcode)
|
231 |
st.write(pathlib.Path(image_1_path).exists())
|
232 |
+
st.write(image_1_path)
|
233 |
st.image(Image.open(image_1_path))
|
utils.py
CHANGED
@@ -108,12 +108,12 @@ 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 |
-
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
|
117 |
|
118 |
# load css + js
|
119 |
cdn_path = "https://cdn.knightlab.com/libs/juxtapose/latest"
|
@@ -124,7 +124,7 @@ def imagecompare(
|
|
124 |
htmlcode = f"""
|
125 |
{css_block}
|
126 |
{js_block}
|
127 |
-
<div id="foo"style="height:
|
128 |
<script>
|
129 |
slider = new juxtapose.JXSlider('#foo',
|
130 |
[
|
|
|
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) * 0.95
|
117 |
|
118 |
# load css + js
|
119 |
cdn_path = "https://cdn.knightlab.com/libs/juxtapose/latest"
|
|
|
124 |
htmlcode = f"""
|
125 |
{css_block}
|
126 |
{js_block}
|
127 |
+
<div id="foo"style="height: {height}; width: {width or '%100'};"></div>
|
128 |
<script>
|
129 |
slider = new juxtapose.JXSlider('#foo',
|
130 |
[
|