amildravid4292 commited on
Commit
9bff723
·
verified ·
1 Parent(s): 388279e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -17
app.py CHANGED
@@ -386,16 +386,7 @@ def file_upload(file):
386
  return image
387
 
388
 
389
- def crop_image(image):
390
- h, w, c = image.shape
391
- if h < w:
392
- offset = (w - h) // 2
393
- image = image[:, offset:offset + h]
394
- elif w < h:
395
- offset = (h - w) // 2
396
- image = image[offset:offset + w]
397
- image = np.array(Image.fromarray(image).resize((512, 512)))
398
- return image
399
 
400
  intro = """
401
  <div style="display: flex;align-items: center;justify-content: center">
@@ -485,13 +476,6 @@ with gr.Blocks(css="style.css") as demo:
485
 
486
 
487
 
488
- input_image.upload(
489
- fn = crop_image,
490
- inputs = [input_image],
491
- outputs = [input_image],
492
- queue=False
493
- )
494
-
495
 
496
  invert_button.click(fn=run_inversion,
497
  inputs=[input_image, pcs, epochs, weight_decay,lr],
 
386
  return image
387
 
388
 
389
+
 
 
 
 
 
 
 
 
 
390
 
391
  intro = """
392
  <div style="display: flex;align-items: center;justify-content: center">
 
476
 
477
 
478
 
 
 
 
 
 
 
 
479
 
480
  invert_button.click(fn=run_inversion,
481
  inputs=[input_image, pcs, epochs, weight_decay,lr],