Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -386,12 +386,9 @@ def find_top_slices(slice_stats, exclusion_list, min_percent=0.7, min_slices=1,
|
|
386 |
|
387 |
return valid_top_slices
|
388 |
|
389 |
-
def extract_and_visualize_top_slices(image, top_slices, slice_size=128):
|
390 |
-
"""从原始图像中提取并可视化顶部切片"""
|
391 |
-
import matplotlib.pyplot as plt
|
392 |
-
|
393 |
fig, axs = plt.subplots(nrows=len(top_slices), ncols=3, figsize=(15, 5 * len(top_slices)))
|
394 |
-
|
395 |
if len(top_slices) == 1:
|
396 |
axs = [axs]
|
397 |
|
|
|
386 |
|
387 |
return valid_top_slices
|
388 |
|
389 |
+
def extract_and_visualize_top_slices(image, top_slices, slice_size=128):
|
|
|
|
|
|
|
390 |
fig, axs = plt.subplots(nrows=len(top_slices), ncols=3, figsize=(15, 5 * len(top_slices)))
|
391 |
+
image=Image.fromarray(image)
|
392 |
if len(top_slices) == 1:
|
393 |
axs = [axs]
|
394 |
|