Spaces:
Build error
Build error
Commit
·
584248d
1
Parent(s):
a5545ff
updates
Browse files
app.py
CHANGED
|
@@ -43,15 +43,17 @@ if "draw" not in st.session_state:
|
|
| 43 |
st.session_state["draw"] = True
|
| 44 |
|
| 45 |
def patch(ij):
|
| 46 |
-
st.write(ij)
|
| 47 |
immg=ij//n_patches
|
| 48 |
-
|
| 49 |
|
| 50 |
imm=ds[int(immg)]['image'].resize(size=(512,512))
|
| 51 |
|
| 52 |
-
|
| 53 |
-
y=p
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
return imc
|
| 56 |
|
| 57 |
def find():
|
|
|
|
| 43 |
st.session_state["draw"] = True
|
| 44 |
|
| 45 |
def patch(ij):
|
| 46 |
+
#st.write(ij)
|
| 47 |
immg=ij//n_patches
|
| 48 |
+
|
| 49 |
|
| 50 |
imm=ds[int(immg)]['image'].resize(size=(512,512))
|
| 51 |
|
| 52 |
+
p=ij%n_patches
|
| 53 |
+
y=p//gridsize
|
| 54 |
+
x=p%gridsize
|
| 55 |
+
imc=imm.crop(((x-1)*stride,(y-1)*stride,(x+3)*stride,(y+3)*stride))
|
| 56 |
+
|
| 57 |
return imc
|
| 58 |
|
| 59 |
def find():
|