Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -180,7 +180,7 @@ def upload_page():
|
|
| 180 |
|
| 181 |
# Count and display the number of patches
|
| 182 |
num_patches = len([f for f in os.listdir(PATCHES_DIR) if f.endswith('.png')])
|
| 183 |
-
st.write(f"Number of patches created: {num_patches}") # Debug output
|
| 184 |
|
| 185 |
# Display buffer while analyzing
|
| 186 |
with st.spinner('Analyzing...'):
|
|
@@ -188,7 +188,7 @@ def upload_page():
|
|
| 188 |
for patch_filename in os.listdir(PATCHES_DIR):
|
| 189 |
if patch_filename.endswith(".png"):
|
| 190 |
patch_path = os.path.join(PATCHES_DIR, patch_filename)
|
| 191 |
-
st.write(f"Processing patch: {patch_path}") # Debug output
|
| 192 |
patch_img = Image.open(patch_path)
|
| 193 |
patch_tr_img = transforms(patch_img)
|
| 194 |
prediction = predict(patch_tr_img)
|
|
@@ -196,7 +196,7 @@ def upload_page():
|
|
| 196 |
mask_filename = f"mask_{patch_filename}"
|
| 197 |
mask_filepath = os.path.join(PRED_PATCHES_DIR, mask_filename)
|
| 198 |
Image.fromarray(mask).save(mask_filepath)
|
| 199 |
-
st.write(f"Saved mask: {mask_filepath}") # Debug output
|
| 200 |
|
| 201 |
# Merge predicted patches
|
| 202 |
merged_mask_filename = f"mask_{timestamp}.png"
|
|
|
|
| 180 |
|
| 181 |
# Count and display the number of patches
|
| 182 |
num_patches = len([f for f in os.listdir(PATCHES_DIR) if f.endswith('.png')])
|
| 183 |
+
#st.write(f"Number of patches created: {num_patches}") # Debug output
|
| 184 |
|
| 185 |
# Display buffer while analyzing
|
| 186 |
with st.spinner('Analyzing...'):
|
|
|
|
| 188 |
for patch_filename in os.listdir(PATCHES_DIR):
|
| 189 |
if patch_filename.endswith(".png"):
|
| 190 |
patch_path = os.path.join(PATCHES_DIR, patch_filename)
|
| 191 |
+
#st.write(f"Processing patch: {patch_path}") # Debug output
|
| 192 |
patch_img = Image.open(patch_path)
|
| 193 |
patch_tr_img = transforms(patch_img)
|
| 194 |
prediction = predict(patch_tr_img)
|
|
|
|
| 196 |
mask_filename = f"mask_{patch_filename}"
|
| 197 |
mask_filepath = os.path.join(PRED_PATCHES_DIR, mask_filename)
|
| 198 |
Image.fromarray(mask).save(mask_filepath)
|
| 199 |
+
#st.write(f"Saved mask: {mask_filepath}") # Debug output
|
| 200 |
|
| 201 |
# Merge predicted patches
|
| 202 |
merged_mask_filename = f"mask_{timestamp}.png"
|