VMarsocci / 3DCD

Remote sensing elevation (3D) change detection with deep learning
https://sites.google.com/uniroma1.it/3dchangedetection/home-page
28 stars 2 forks source link

result visualization #6

Closed Jasmine-wrl closed 10 months ago

Jasmine-wrl commented 10 months ago

Could you tell me how can I realize 3D result visualization?Thanks!

VMarsocci commented 10 months ago

We will provide a script with inference and visualization in a few weeks. I will make sure to comment on this issue once updated. Thanks for asking

Jasmine-wrl commented 9 months ago

I'm sorry to bother you again, but I still want to know how to display the image (c, d, f) in the following picture.If possible, could you please let me know? My time is very tight.Thank you again! ex1

VMarsocci commented 9 months ago

with our model we can only infer e) and f). So if you are using our data c) and d) are DSMs not used during training.

For visualizing the 3D predictions we used a testing loop similar to this (but as I told you we still have to clean it):

res_2d= []
res_3d= []
im_couple= []

for t1, t2, mask2d, mask3d in tqdm(test_loader):

  t1 = t1.to(device)
  t2 = t2.to(device)

  out2d, out3d = net(t1, t2)
  out2d = out2d.detach().argmax(dim=1)
  out2d = out2d.cpu().numpy()
  out3d = out3d.detach().cpu().numpy()
  out3d = (out3d*(max_scale - min_scale)+(max_scale+min_scale))/2

  im_couple.append([t1.cpu().squeeze().permute((1,2,0)), t2.cpu().squeeze().permute((1,2,0))])
  res_2d.append([out2d.squeeze(), mask2d.squeeze()])
  res_3d.append([out3d.squeeze(), mask3d.squeeze()])

then you can easily visualize each predicted map, for example:

tiff.imshow(res_3d[n][0],vmin=-25, vmax=30)

Jasmine-wrl commented 8 months ago

Thanks to your reply, I can now obtain 3D visualization images. Can you tell me how to display image c and d based on optical images a and b and DSM data?