Update README.md
Browse files
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 |
-
|
| 96 |
-
hr_early_torch,
|
|
|
|
|
|
|
| 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(
|
| 108 |
-
ax = ax.flatten()
|
| 109 |
ax[0].imshow(hr_early_torch[[3, 1, 2]].permute(1, 2, 0))
|
| 110 |
-
ax[0].set_title("
|
| 111 |
-
ax[1].imshow(
|
| 112 |
-
ax[1].set_title("
|
| 113 |
-
ax[2].imshow(
|
| 114 |
-
ax[2].set_title("
|
| 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="
|
| 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
|