fradinho commited on
Commit
81d0780
1 Parent(s): 660bf3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -118,7 +118,7 @@ def predict_patches(image):
118
  image = Image.fromarray(image).resize((size,size))
119
  image = np.array(image)/255
120
  emp = EMPatches()
121
- img_patches, indices = emp.extract_patches(image, patchsize=pach_size, overlap=0.2, stride=int(pach_size/2))
122
  pred = model.predict(np.array(img_patches))
123
  # Postprocess the mask
124
  #print(pred)
@@ -246,8 +246,8 @@ with my_app:
246
  output_label = gr.Label(label="Predicted Masked Image")
247
  img_output = gr.Image(label="Image Output")
248
  source_image_loader.click(
249
- predict_2,
250
- #predict_patches,
251
  [
252
  img_source
253
  ],
 
118
  image = Image.fromarray(image).resize((size,size))
119
  image = np.array(image)/255
120
  emp = EMPatches()
121
+ img_patches, indices = emp.extract_patches(image, patchsize=pach_size, overlap=0.25, stride=int(pach_size/4))
122
  pred = model.predict(np.array(img_patches))
123
  # Postprocess the mask
124
  #print(pred)
 
246
  output_label = gr.Label(label="Predicted Masked Image")
247
  img_output = gr.Image(label="Image Output")
248
  source_image_loader.click(
249
+ #predict_2,
250
+ predict_patches,
251
  [
252
  img_source
253
  ],