Circularmachines commited on
Commit
584248d
·
1 Parent(s): a5545ff
Files changed (1) hide show
  1. app.py +7 -5
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
- p=ij%n_patches
49
 
50
  imm=ds[int(immg)]['image'].resize(size=(512,512))
51
 
52
- x=p//gridsize
53
- y=p%gridsize
54
- imc=imm.crop(((x)*stride,(y)*stride,(x+2)*stride,(y+2)*stride))
 
 
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():