Spaces:
Build error
Build error
Update app.py
Browse files
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.
|
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 |
-
|
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 |
],
|