Circularmachines
commited on
Commit
•
065bb16
1
Parent(s):
d14ce97
updates
Browse files
app.py
CHANGED
@@ -95,9 +95,30 @@ def find():
|
|
95 |
i=st.session_state["img"]
|
96 |
p=point[1]*gridsize+point[0]
|
97 |
diff=np.linalg.norm(pred_all[np.newaxis,i*gridsize**2+p,:]-pred_all,axis=-1)
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
#st.write(diff.argsort()[ix])
|
103 |
|
@@ -159,7 +180,7 @@ with col2:
|
|
159 |
|
160 |
for i in range(4):
|
161 |
st.image(st.session_state["sideimg"][i].resize((128,128)))
|
162 |
-
st.write(st.session_state["sideix"][i]
|
163 |
-
st.write(st.session_state["sideix"][i])
|
164 |
|
165 |
|
|
|
95 |
i=st.session_state["img"]
|
96 |
p=point[1]*gridsize+point[0]
|
97 |
diff=np.linalg.norm(pred_all[np.newaxis,i*gridsize**2+p,:]-pred_all,axis=-1)
|
98 |
+
#re_pred=pred_all.reshape(20,20,256,64)
|
99 |
+
#diff_re=diff.reshape((20,20,256)).argmin(axis=[])
|
100 |
+
i=0
|
101 |
+
ix=0
|
102 |
+
batches=[]
|
103 |
+
while ix<4:
|
104 |
+
|
105 |
+
#for ix in range(4):
|
106 |
+
|
107 |
+
batch=diff.argsort()[i]//(gridsize**2)//20
|
108 |
+
|
109 |
+
if batch not in batches:
|
110 |
+
|
111 |
+
batches.append(batch)
|
112 |
+
|
113 |
+
st.session_state["sideimg"][ix]=patch(diff.argsort()[i])
|
114 |
+
ix+=1
|
115 |
+
|
116 |
+
i+=1
|
117 |
+
|
118 |
+
st.session_state["sideix"]=batches
|
119 |
+
|
120 |
+
|
121 |
+
#st.session_state["sideix"][ix]=diff.argsort()[ix]
|
122 |
|
123 |
#st.write(diff.argsort()[ix])
|
124 |
|
|
|
180 |
|
181 |
for i in range(4):
|
182 |
st.image(st.session_state["sideimg"][i].resize((128,128)))
|
183 |
+
st.write("batch: "+str(st.session_state["sideix"][i]#//(gridsize**2)//20))
|
184 |
+
#st.write(st.session_state["sideix"][i])
|
185 |
|
186 |
|