Yeefei commited on
Commit
3ce75bf
·
verified ·
1 Parent(s): ab91f6c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -342,7 +342,8 @@ def infer_brain_cf(*args):
342
  cf_[k] = (out["cf_pa"][k].mean(0).item() + 1) / 2 * (k_max - k_min) + k_min
343
  # plots
344
  # plt.close('all')
345
- effect = cf_x - rec_x
 
346
  effect = get_fig_arr(
347
  effect,
348
  cmap="RdBu_r",
@@ -406,10 +407,12 @@ def infer_chest_cf(*args):
406
  cf_a = out["cf_pa"]["age"].mean(0)
407
  # post process
408
  cf_x = postprocess(cf_x)
409
- # print(cf_x[144,27])
 
410
  cf_x_std = cf_x_std.squeeze().detach().cpu().numpy()
411
  rec_x = postprocess(rec_x)
412
- # print(rec_x[144,27])
 
413
  cf_r = RACE_CAT[cf_r.argmax(-1)]
414
  cf_s = SEX_CAT_CHEST[int(cf_s.item())]
415
  cf_f = FIND_CAT[cf_f.argmax(-1)] #FIND_CAT[int(cf_f.item())]
@@ -417,8 +420,8 @@ def infer_chest_cf(*args):
417
  # plots
418
  # plt.close('all')
419
  effect = cf_x - rec_x
420
- print(effect.max())
421
- print(effect.min())
422
  effect = get_fig_arr(
423
  effect,
424
  cmap="RdBu_r",
 
342
  cf_[k] = (out["cf_pa"][k].mean(0).item() + 1) / 2 * (k_max - k_min) + k_min
343
  # plots
344
  # plt.close('all')
345
+ # effect = cf_x - rec_x
346
+ effect = cf_x - obs["x"]
347
  effect = get_fig_arr(
348
  effect,
349
  cmap="RdBu_r",
 
407
  cf_a = out["cf_pa"]["age"].mean(0)
408
  # post process
409
  cf_x = postprocess(cf_x)
410
+ print(cf_x.max())
411
+ print(cf_x.min())
412
  cf_x_std = cf_x_std.squeeze().detach().cpu().numpy()
413
  rec_x = postprocess(rec_x)
414
+ print(rec_x.max())
415
+ print(rec_x.min())
416
  cf_r = RACE_CAT[cf_r.argmax(-1)]
417
  cf_s = SEX_CAT_CHEST[int(cf_s.item())]
418
  cf_f = FIND_CAT[cf_f.argmax(-1)] #FIND_CAT[int(cf_f.item())]
 
420
  # plots
421
  # plt.close('all')
422
  effect = cf_x - rec_x
423
+ # print(effect.max())
424
+ # print(effect.min())
425
  effect = get_fig_arr(
426
  effect,
427
  cmap="RdBu_r",