I have a TensorFlow model that is trained on an array of reflectance values (red, green, blue, nir) to predict sediment (SSC).
Now, I want to use Landsat 8 image over a region to get the SSC for each pixel in the image.One way that I'm aware of but not sure of implementation is to export each band of image to Google Drive as a GeoTIFF and then read in the file to Colab using the rasterio package.
Here is my code:
L8imgs = (ee.ImageCollection('LANDSAT/LC08/C01/T1_SR').filterDate(startDate, endDate).filterBounds(ROI))
L8imgs = L8imgs.select(['B2', 'B3','B4','B5'], ['blue', 'green', 'red', 'nir'])
L8imgs = L8imgs.map(runModel)
def ann_SSCL8(img):
I = ee.Image(img)
## HOW TO INPUT BAND VALUES AS ARRAY TO tfModel ??
input=[I.select('blue'),I.select('green'), I.select('nir'), I.select('red')]
ssc = tfModel.predict(input) #tfModel stored on drive