alessandro trinca tornidor
commited on
Commit
·
fd5c95e
1
Parent(s):
db29e38
bug: remove logging app_logger instance that broke lisa inference_fn
Browse files
samgis_lisa_on_zero/prediction_api/lisa.py
CHANGED
@@ -79,10 +79,17 @@ def lisa_predict(
|
|
79 |
else:
|
80 |
app_logger.info("keep all temp data in memory...")
|
81 |
|
82 |
-
app_logger.info(f"source_name:{source_name}, source_name type:{type(source_name)}.")
|
|
|
|
|
|
|
|
|
83 |
embedding_key = f"{source_name}_z{zoom}_{prefix}"
|
84 |
-
_, mask, output_string = inference_fn(
|
85 |
-
|
|
|
|
|
|
|
86 |
return {
|
87 |
"output_string": output_string,
|
88 |
**get_vectorized_raster_as_geojson(mask, transform)
|
|
|
79 |
else:
|
80 |
app_logger.info("keep all temp data in memory...")
|
81 |
|
82 |
+
app_logger.info(f"lisa_zero, source_name:{source_name}, source_name type:{type(source_name)}.")
|
83 |
+
app_logger.info(f"lisa_zero, prompt tpye:{type(prompt)}.")
|
84 |
+
app_logger.info(f"lisa_zero, prompt:{prompt}.")
|
85 |
+
prompt_str = str(prompt)
|
86 |
+
app_logger.info(f"lisa_zero, img tpye:{type(img)}.")
|
87 |
embedding_key = f"{source_name}_z{zoom}_{prefix}"
|
88 |
+
_, mask, output_string = inference_fn(input_str=prompt_str, input_image=img, embedding_key=embedding_key)
|
89 |
+
app_logger.info(f"lisa_zero, output_string tpye:{type(output_string)}.")
|
90 |
+
app_logger.info(f"lisa_zero, output_string:{output_string}.")
|
91 |
+
app_logger.info(f"lisa_zero, mask_output tpye:{type(mask)}.")
|
92 |
+
app_logger.info(f"created output_string '{output_string}', preparing conversion to geojson...")
|
93 |
return {
|
94 |
"output_string": output_string,
|
95 |
**get_vectorized_raster_as_geojson(mask, transform)
|