Datasets:

License:
csaybar commited on
Commit
02a7656
·
verified ·
1 Parent(s): e7cc0c9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -22
README.md CHANGED
@@ -92,37 +92,26 @@ synthetic_path = DEMO_PATH + "synthetic/ROI_0001/"
92
  hr_early_data = rioxarray.open_rasterio(synthetic_path + "early/01__m_4506807_nw_19_1_20110818.tif")
93
  hr_early_torch = torch.from_numpy(hr_early_data.to_numpy()) / 255
94
  hr_early_metadata = load_metadata(synthetic_path + "late/metadata.json")
95
- hr_early_torch_hat = opensr_degradation.main.predict_table(
96
- hr_early_torch, hr_early_metadata["sim_histograms"], "gamma_multivariate_normal_50"
 
 
97
  )
98
 
99
- hr_late_data = rioxarray.open_rasterio(synthetic_path + "late/02__m_4506807_nw_19_060_20210920.tif")
100
- hr_late_torch = torch.from_numpy(hr_late_data.to_numpy()) / 255
101
- hr_late_metadata = load_metadata(synthetic_path + "late/metadata.json")
102
- hr_late_torch_hat = opensr_degradation.main.predict_table(
103
- hr_late_torch, hr_late_metadata["sim_histograms"], "gamma_multivariate_normal_50"
104
- )
105
 
106
  import matplotlib.pyplot as plt
107
- fig, ax = plt.subplots(2, 2, figsize=(10, 5))
108
- ax = ax.flatten()
109
  ax[0].imshow(hr_early_torch[[3, 1, 2]].permute(1, 2, 0))
110
- ax[0].set_title("Original")
111
- ax[1].imshow(hr_early_torch_hat[[3, 1, 2]].permute(1, 2, 0)*3)
112
- ax[1].set_title("Degraded")
113
- ax[2].imshow(hr_late_torch[[3, 1, 2]].permute(1, 2, 0))
114
- ax[2].set_title("Original")
115
- ax[3].imshow(hr_late_torch_hat[[3, 1, 2]].permute(1, 2, 0)*3)
116
- ax[3].set_title("Degraded")
117
- # remove axis and space
118
- for a in ax:
119
- a.axis("off")
120
- plt.tight_layout()
121
  plt.show()
122
  ```
123
 
124
  <center>
125
- <img src="demo/image_demo.png" width=75%>
126
  </center>
127
 
128
  # CITATION
 
92
  hr_early_data = rioxarray.open_rasterio(synthetic_path + "early/01__m_4506807_nw_19_1_20110818.tif")
93
  hr_early_torch = torch.from_numpy(hr_early_data.to_numpy()) / 255
94
  hr_early_metadata = load_metadata(synthetic_path + "late/metadata.json")
95
+ lr_hat, hr_hat = opensr_degradation.main.get_s2like(
96
+ image=hr_early_torch,
97
+ table=hr_early_metadata["sim_histograms"],
98
+ model="gamma_multivariate_normal_50"
99
  )
100
 
 
 
 
 
 
 
101
 
102
  import matplotlib.pyplot as plt
103
+ fig, ax = plt.subplots(1, 3, figsize=(10, 5))
 
104
  ax[0].imshow(hr_early_torch[[3, 1, 2]].permute(1, 2, 0))
105
+ ax[0].set_title("NAIP")
106
+ ax[1].imshow(hr_hat[[3, 1, 2]].permute(1, 2, 0)*3)
107
+ ax[1].set_title("NAIPhat")
108
+ ax[2].imshow(lr_hat[[3, 1, 2]].permute(1, 2, 0)*3)
109
+ ax[2].set_title("S2like")
 
 
 
 
 
 
110
  plt.show()
111
  ```
112
 
113
  <center>
114
+ <img src="https://github.com/ESAOpenSR/opensr-degradation/assets/16768318/c88fa16e-bbe7-4072-b518-5ab3b7278893" width=75%>
115
  </center>
116
 
117
  # CITATION