yvokeller commited on
Commit
13efa6d
1 Parent(s): 1912458

switch to AWS COG for satellite data

Browse files
inference.py CHANGED
@@ -199,10 +199,10 @@ def crop_predictions_to_gdf(field_ids, targets, predictions, transform, crs, cla
199
  return gdf
200
 
201
  def perform_inference(lon, lat, model, config, debug=False):
202
- features_path = "../data/stacked_features.tif"
203
- labels_path = "../data/labels.tif"
204
- field_ids_path = "../data/field_ids.tif"
205
- stats_path = "../data/chips_stats.yaml"
206
 
207
  loader = InferenceDataLoader(features_path, labels_path, field_ids_path, stats_path, n_timesteps=9, fold_indices=[0], debug=True)
208
 
 
199
  return gdf
200
 
201
  def perform_inference(lon, lat, model, config, debug=False):
202
+ features_path = "./data/stacked_features.tif"
203
+ labels_path = "./data/labels.tif"
204
+ field_ids_path = "./data/field_ids.tif"
205
+ stats_path = "./data/chips_stats.yaml"
206
 
207
  loader = InferenceDataLoader(features_path, labels_path, field_ids_path, stats_path, n_timesteps=9, fold_indices=[0], debug=True)
208
 
pages/2_Perform_Crop_Classification.py CHANGED
@@ -79,13 +79,22 @@ def perform_inference_step():
79
  st.success("Inference completed!")
80
 
81
  # GeoTIFF Satellite Imagery with selected timestep and band
82
- m.add_raster(
83
- GEOTIFF_PATH,
84
- layer_name="Satellite Image",
 
 
 
 
 
 
 
 
 
 
85
  bands=selected_bands,
86
- fit_bounds=True,
87
- vmin=vmin_vmax[selected_band][0],
88
- vmax=vmin_vmax[selected_band][1],
89
  )
90
 
91
  # Show the POI on the map
 
79
  st.success("Inference completed!")
80
 
81
  # GeoTIFF Satellite Imagery with selected timestep and band
82
+ # m.add_raster(
83
+ # GEOTIFF_PATH,
84
+ # layer_name="Satellite Image",
85
+ # bands=selected_bands,
86
+ # fit_bounds=True,
87
+ # vmin=vmin_vmax[selected_band][0],
88
+ # vmax=vmin_vmax[selected_band][1],
89
+ # )
90
+
91
+ # Add COG
92
+ m.add_cog_layer(
93
+ url="https://messis-demo.s3.amazonaws.com/stacked_features_cog.tif",
94
+ name="AWS COG",
95
  bands=selected_bands,
96
+ rescale=f"{vmin_vmax[selected_band][0]},{vmin_vmax[selected_band][1]}",
97
+ zoom_to_layer=True
 
98
  )
99
 
100
  # Show the POI on the map