Skip to content

Commit 6170535

Browse files
committed
Fix image rendering in the supervised ML docs
Signed-off-by: Jason T. Brown <[email protected]>
1 parent e62ef2e commit 6170535

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyrasterframes/src/main/python/docs/supervised-learning.pymd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ SELECT extent, crs,
200200
rf_assemble_tile(column_index, row_index, prediction, 128, 128) as prediction,
201201
rf_assemble_tile(column_index, row_index, B04, 128, 128) as red,
202202
rf_assemble_tile(column_index, row_index, B03, 128, 128) as grn,
203-
rf_assemble_tile(column_index, row_index, B02, 128, 128) as blu,
203+
rf_assemble_tile(column_index, row_index, B02, 128, 128) as blu
204204
FROM scored
205205
GROUP BY extent, crs
206206
""")
@@ -221,7 +221,8 @@ red = sample['red'].cells
221221
grn = sample['grn'].cells
222222
blu = sample['blu'].cells
223223
sample_rgb = np.concatenate([red[ :, :, None], grn[:, :, None] , blu[ :, :, None]], axis=2)
224-
np.imshow(sample_rgb)
224+
mins = np.nanmin(sample_rgb, axis=(0,1))
225+
plt.imshow((sample_rgb - mins)/ (np.nanmax(sample_rgb, axis=(0,1)) - mins))
225226
```
226227

227228
Recall the label coding: 1 is forest (purple), 2 is cropland (green) and 3 is developed areas(yellow).

0 commit comments

Comments
 (0)