Skip to content
Snippets Groups Projects
Commit bf6ad1f1 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Logged ilastik events

parent b66b851c
No related branches found
No related tags found
2 merge requests!16Completed (de)serialization of RoiSet,!9Session exposes a python log
......@@ -25,9 +25,11 @@ def load_ilastik_model(model_class: ilm.IlastikModel, project_file: str, duplica
if not duplicate:
existing_model_id = session.find_param_in_loaded_models('project_file', project_file, is_path=True)
if existing_model_id is not None:
session.log_info(f'An ilastik model from {project_file} already existing exists; did not load a duplicate')
return {'model_id': existing_model_id}
try:
result = session.load_model(model_class, {'project_file': project_file})
session.log_info(f'Loaded ilastik model {result} from {project_file}')
except (FileNotFoundError, ParameterExpectedError):
raise HTTPException(
status_code=404,
......@@ -60,6 +62,7 @@ def infer_px_then_ob_maps(px_model_id: str, ob_model_id: str, input_filename: st
channel=channel,
mip=mip,
)
session.log_info(f'Completed pixel and object classification of {input_filename}')
except AssertionError:
raise HTTPException(f'Incompatible models {px_model_id} and/or {ob_model_id}')
return record
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment