Omnibus commited on
Commit
9ede6fd
1 Parent(s): fd5acb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -147,13 +147,15 @@ def load_im(img):
147
  width, height = im.size
148
  new_w=int(width/10)
149
  new_h=new_w
150
- for i in range(height):
 
 
151
  print(i)
152
- for b in range(width):
153
  print(b)
154
  # Setting the points for cropped image
155
- left = b
156
- top = i
157
  right = left+new_w
158
  bottom = top+new_h
159
 
@@ -161,9 +163,9 @@ def load_im(img):
161
  # (It will not change original image)
162
  im1 = im.crop((left, top, right, bottom))
163
  im_box.append(im1)
164
- b+=new_w
165
  yield im_box
166
- i+=new_h
167
 
168
  with gr.Blocks(css=css) as app:
169
  with gr.Row():
 
147
  width, height = im.size
148
  new_w=int(width/10)
149
  new_h=new_w
150
+ w=0
151
+ h=0
152
+ for i in range(int(height/new_h)):
153
  print(i)
154
+ for b in range(10):
155
  print(b)
156
  # Setting the points for cropped image
157
+ left = w
158
+ top = h
159
  right = left+new_w
160
  bottom = top+new_h
161
 
 
163
  # (It will not change original image)
164
  im1 = im.crop((left, top, right, bottom))
165
  im_box.append(im1)
166
+ w+=new_w
167
  yield im_box
168
+ h+=new_h
169
 
170
  with gr.Blocks(css=css) as app:
171
  with gr.Row():