supundhananjaya commited on
Commit
40747f3
·
verified ·
1 Parent(s): 4531628

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -576,14 +576,18 @@ def MonoGeoDepthModelRun(numpy_image):
576
  noisy_latents = model_input - noise_pred[0]
577
  predicted_dtm = latent_to_tensor(noisy_latents, vae)
578
  predicted_dtm = predicted_dtm.detach().cpu()
579
- print("type 1: ",type(predicted_dtm))
580
 
581
  image_ = predicted_dtm.squeeze(0)
582
  image_ = (image_ - image_.min()) / (image_.max() - image_.min())
583
 
584
- to_pil = ToPILImage()
585
- predicted_dtm = to_pil(image_)
586
- print("type 2: ",type(predicted_dtm))
 
 
 
 
 
587
 
588
  return predicted_dtm
589
 
 
576
  noisy_latents = model_input - noise_pred[0]
577
  predicted_dtm = latent_to_tensor(noisy_latents, vae)
578
  predicted_dtm = predicted_dtm.detach().cpu()
 
579
 
580
  image_ = predicted_dtm.squeeze(0)
581
  image_ = (image_ - image_.min()) / (image_.max() - image_.min())
582
 
583
+ image_np = image_.numpy()
584
+ cmap = plt.get_cmap('jet_r')
585
+ image_colored = cmap(image_np)
586
+ image_colored = image_colored[:, :, :3] # Use only the RGB channels
587
+ predicted_dtm = ToPILImage()(image_colored)
588
+
589
+ # to_pil = ToPILImage()
590
+ # predicted_dtm = to_pil(image_)
591
 
592
  return predicted_dtm
593