Spaces:
Sleeping
Sleeping
Update app.py
Browse files133 unmodified lines13413513613713813914015 unmodified lines156157158159160161162163133 unmodified linesfig, ax = plt.subplots(figsize=(10, 6))mean_score = np.mean(sphere_scores)std_dev = np.std(sphere_scores)ax.hist(sphere_scores, bins=10, color=class_colors.get('P', (255, 255, 255)), alpha=1, range=(0, 1)) #'#0000FF'ax.set_xlim(0, 1)ax.set_ylim(0, max(10, len(sphere_scores) // 2))ax.set_title(f"{len(sphere_scores)} particles detected\nConfidence Score Distribution: {mean_score:.2f} ± {std_dev:.2f}")15 unmodified linesfig2, ax2 = plt.subplots(figsize=(10, 6))for cls, values in object_sizes_nm.items():color = np.array(class_colors.get(5, (0, 0, 255))) / 255.0ax2.hist(values, bins=10, width=4, alpha=1, color=color, label=class_labels.get(cls, f"Class {cls}"))ax2.set_xlabel("Diameter (nm)")ax2.set_ylabel("Number of Detections")mean_size = np.mean([v for l in object_sizes_nm.values() for v in l])133 unmodified lines13413513613713813914014114215 unmodified lines158159160161162163164165133 unmodified linesfig, ax = plt.subplots(figsize=(10, 6))mean_score = np.mean(sphere_scores)std_dev = np.std(sphere_scores)rgb = class_colors.get('P', (255, 255, 255))normalized_rgb = tuple(c / 255 for c in rgb)ax.hist(sphere_scores, bins=10, color=normalized_rgb, alpha=1, range=(0, 1))ax.set_xlim(0, 1)ax.set_ylim(0, max(10, len(sphere_scores) // 2))ax.set_title(f"{len(sphere_scores)} particles detected\nConfidence Score Distribution: {mean_score:.2f} ± {std_dev:.2f}")15 unmodified linesfig2, ax2 = plt.subplots(figsize=(10, 6))for cls, values in object_sizes_nm.items():ax2.hist(values, bins=10, width=4, alpha=1, color=normalized_rgb, label=class_labels.get(cls, f"Class {cls}"))ax2.set_xlabel("Diameter (nm)")ax2.set_ylabel("Number of Detections")mean_size = np.mean([v for l in object_sizes_nm.values() for v in l])
app.py+5-3