Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import streamlit as st
|
|
3 |
import pandas as pd
|
4 |
xl1 = st.file_uploader("Choose first file", key="xl1")
|
5 |
xl2 = st.file_uploader("Choose second file", key="xl2")
|
6 |
-
|
7 |
if xl1 is not None and xl2 is not None:
|
8 |
#assert that the first few columns are the same
|
9 |
df1 = pd.read_excel(xl1, sheet_name= "0.85 Threshold")
|
@@ -17,6 +16,25 @@ if xl1 is not None and xl2 is not None:
|
|
17 |
for t1,t2 in zip(df1.iterrows(),df2.iterrows()):
|
18 |
r1 = t1[1]
|
19 |
r2 = t2[1]
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import pandas as pd
|
4 |
xl1 = st.file_uploader("Choose first file", key="xl1")
|
5 |
xl2 = st.file_uploader("Choose second file", key="xl2")
|
|
|
6 |
if xl1 is not None and xl2 is not None:
|
7 |
#assert that the first few columns are the same
|
8 |
df1 = pd.read_excel(xl1, sheet_name= "0.85 Threshold")
|
|
|
16 |
for t1,t2 in zip(df1.iterrows(),df2.iterrows()):
|
17 |
r1 = t1[1]
|
18 |
r2 = t2[1]
|
19 |
+
assert r1["KP"] == r2["KP"]
|
20 |
+
kps1 = r1["Matched KPs"]
|
21 |
+
kps2 = r2["Matched KPs"]
|
22 |
+
for kp1, kp2 in zip(kps1.keys(),kps2.keys()):
|
23 |
+
if kps1[kp1] > 0.99:
|
24 |
+
kps1.pop(kp1)
|
25 |
+
if kps2[kp2] > 0.99:
|
26 |
+
kps2.pop(kp2)
|
27 |
+
#now display the kps
|
28 |
+
if kps1 == {} and kps2 == {}:
|
29 |
+
continue
|
30 |
+
if kps1 != {}:
|
31 |
+
for kp1 in kps1.keys():
|
32 |
+
with st.container():
|
33 |
+
col1, col2, col3 = st.columns()
|
34 |
+
with col1:
|
35 |
+
st.write(r1["KP"]
|
36 |
+
with col2:
|
37 |
+
st.write(f"kp: {kp1} , distance: {kps1[kp1]}")
|
38 |
+
with col3:
|
39 |
+
st.radio("Appropriate?", [True, False])
|
40 |
+
|