Ephemeral182 / UDR-S2Former_deraining

[ICCV'23] Sparse Sampling Transformer with Uncertainty-Driven Ranking for Unified Removal of Raindrops and Rain Streaks
https://ephemeral182.github.io/UDR_S2Former_deraining/
128 stars 7 forks source link

visualizing uncertainty graphs #3

Closed 61966 closed 6 months ago

61966 commented 9 months ago

This is a great job, but can the author provide code for visualizing uncertainty graphs so that the work can be better disseminated.

Ephemeral182 commented 9 months ago

Thanks for your attention to our job. It is an easy thing to visualize uncertainty graphs, which can be seen by only using the heat map of the matplotlib package, as follows: def getcmap(x: torch.Tensor, path: str): import matplotlib.pyplot as plt x = x.squeeze(0).cpu().numpy() xmean = x.transpose(1,2,0).mean(2) plt.imshow(x_mean,cmap='summer_r') plt.savefig(path) where x denotes the feature level of the uncertainty map. For example, you can obtain the final uncertainty map via nn.Sequential(*[nn.Conv2d(dim[0],dim[0],3,1,1), nn.ELU(),nn.Conv2d(dim[0],out_cahnnels,3,1,1)]), just like the line 839 in the UDR_S2Former.py.