Spaces:
Running on Zero
Running on Zero
Condensate Titration: caption each generated image with its expression level only
Browse files
app.py
CHANGED
|
@@ -123,13 +123,12 @@ def plot_curve(result: pipeline.Result):
|
|
| 123 |
|
| 124 |
|
| 125 |
def sample_gallery(result: pipeline.Result):
|
| 126 |
-
"""Every generated image along the ladder, captioned with its
|
| 127 |
-
is checkable by eye."""
|
| 128 |
magma = matplotlib.colormaps["magma"]
|
| 129 |
-
calls = ["condensed" if p else "diffuse" for p in result.predictions]
|
| 130 |
return [
|
| 131 |
-
((magma(np.clip(img, 0, 1))[..., :3] * 255).astype(np.uint8), f"{level:.0f}
|
| 132 |
-
for img, level
|
| 133 |
]
|
| 134 |
|
| 135 |
|
|
@@ -212,7 +211,7 @@ def build_condensate_titration_section():
|
|
| 212 |
|
| 213 |
curve_plot = gr.Plot(label="Condensate titration curve")
|
| 214 |
sample_plot = gr.Gallery(
|
| 215 |
-
label="Generated images (protein channel
|
| 216 |
columns=8, height=520, allow_preview=True, object_fit="contain",
|
| 217 |
)
|
| 218 |
|
|
|
|
| 123 |
|
| 124 |
|
| 125 |
def sample_gallery(result: pipeline.Result):
|
| 126 |
+
"""Every generated image along the ladder, captioned with its protein expression level, so the
|
| 127 |
+
curve is checkable by eye."""
|
| 128 |
magma = matplotlib.colormaps["magma"]
|
|
|
|
| 129 |
return [
|
| 130 |
+
((magma(np.clip(img, 0, 1))[..., :3] * 255).astype(np.uint8), f"{level:.0f}")
|
| 131 |
+
for img, level in zip(result.images, result.image_intensities)
|
| 132 |
]
|
| 133 |
|
| 134 |
|
|
|
|
| 211 |
|
| 212 |
curve_plot = gr.Plot(label="Condensate titration curve")
|
| 213 |
sample_plot = gr.Gallery(
|
| 214 |
+
label="Generated images (protein channel), captioned with the protein expression level (a.u.)",
|
| 215 |
columns=8, height=520, allow_preview=True, object_fit="contain",
|
| 216 |
)
|
| 217 |
|