BoHuangLab commited on
Commit
0211f62
·
verified ·
1 Parent(s): 815c5e5

Condensate Titration: caption each generated image with its expression level only

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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 level and call, so the curve
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} \u00b7 {call}")
132
- for img, level, call in zip(result.images, result.image_intensities, calls)
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; intensity level \u00b7 classifier call)",
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