Fix auth connection
Browse files- app.py +2 -1
- worldcereal/job.py +3 -1
app.py
CHANGED
|
@@ -185,7 +185,8 @@ def run_openeo_job(lat, lon, size_km=1.0):
|
|
| 185 |
spatial_extent=spatial_extent,
|
| 186 |
temporal_extent=temporal_extent,
|
| 187 |
embeddings_parameters=embedding_params,
|
| 188 |
-
scale_uint16=True
|
|
|
|
| 189 |
)
|
| 190 |
|
| 191 |
job_title = f"thesis_demo_{lat}_{lon}"
|
|
|
|
| 185 |
spatial_extent=spatial_extent,
|
| 186 |
temporal_extent=temporal_extent,
|
| 187 |
embeddings_parameters=embedding_params,
|
| 188 |
+
scale_uint16=True,
|
| 189 |
+
connection=con
|
| 190 |
)
|
| 191 |
|
| 192 |
job_title = f"thesis_demo_{lat}_{lon}"
|
worldcereal/job.py
CHANGED
|
@@ -301,6 +301,7 @@ def create_embeddings_process_graph(
|
|
| 301 |
tile_size: Optional[int] = 128,
|
| 302 |
target_epsg: Optional[int] = None,
|
| 303 |
scale_uint16: bool = True,
|
|
|
|
| 304 |
) -> openeo.DataCube:
|
| 305 |
"""Create an OpenEO process graph for generating embeddings.
|
| 306 |
|
|
@@ -340,7 +341,8 @@ def create_embeddings_process_graph(
|
|
| 340 |
raise ValueError(f"Format {format} not supported.")
|
| 341 |
|
| 342 |
# Make a connection to the OpenEO backend
|
| 343 |
-
connection
|
|
|
|
| 344 |
|
| 345 |
# Preparing the input cube for inference
|
| 346 |
inputs = worldcereal_preprocessed_inputs(
|
|
|
|
| 301 |
tile_size: Optional[int] = 128,
|
| 302 |
target_epsg: Optional[int] = None,
|
| 303 |
scale_uint16: bool = True,
|
| 304 |
+
connection: Optional[openeo.Connection] = None, # added by Remi
|
| 305 |
) -> openeo.DataCube:
|
| 306 |
"""Create an OpenEO process graph for generating embeddings.
|
| 307 |
|
|
|
|
| 341 |
raise ValueError(f"Format {format} not supported.")
|
| 342 |
|
| 343 |
# Make a connection to the OpenEO backend
|
| 344 |
+
if connection is None:
|
| 345 |
+
connection = BACKEND_CONNECTIONS[backend_context.backend]()
|
| 346 |
|
| 347 |
# Preparing the input cube for inference
|
| 348 |
inputs = worldcereal_preprocessed_inputs(
|