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

Marked up TODOs

parent cf493168
No related branches found
No related tags found
No related merge requests found
......@@ -283,7 +283,7 @@ def write_accessor_data_to_file(fpath: Path, acc: GenericImageDataAccessor, mkdi
raise FileWriteError(f'Unable to write data to file of extension {ext}')
return True
# TODO: deprecate and move into GenericImageFile
def generate_file_accessor(fpath):
"""
Given an image file path, return an image accessor, assuming the file is a supported format and represents
......
......@@ -53,6 +53,16 @@ def restart_session(root: str = None) -> dict:
def list_session_log() -> list:
return session.get_log_data()
# TODO: endpoints to load image data via file
@app.get('/data/file/import')
def import_data_from_file() -> str:
pass
# TODO: endpoints to load image data via file
@app.get('/data/file/import')
def import_data_from_file():
pass
@app.get('/models')
def list_active_models():
return session.describe_loaded_models()
......@@ -131,6 +131,8 @@ class _Session(object):
def log_error(self, msg):
logger.error(msg)
# TODO: load, describe, unload data accessors
def load_model(self, ModelClass: Model, params: Union[BaseModel, None] = None) -> dict:
"""
Load an instance of a given model class and attach to this session's model registry
......
......@@ -102,7 +102,7 @@ class IlastikModel(Model):
class IlastikPixelClassifierParams(IlastikParams):
px_class: int = 0
px_prob_threshold: float = 0.5
px_smoothing: float = 0.0
px_smoothing: float = 0.0 # TODO: remove
class IlastikPixelClassifierModel(IlastikModel, SemanticSegmentationModel):
model_id = 'ilastik_pixel_classification'
......@@ -165,6 +165,7 @@ class IlastikPixelClassifierModel(IlastikModel, SemanticSegmentationModel):
continue
return PatchStack(data), {'success': True}
# TODO: remove smoothing logic, defer to calling pipeline
def label_pixel_class(self, img: GenericImageDataAccessor, **kwargs):
pxmap, _ = self.infer(img)
sig = self.params['px_smoothing']
......
......@@ -32,6 +32,7 @@ def load_ilastik_model(model_class: ilm.IlastikModel, params: ilm.IlastikParams)
return {'model_id': result}
@router.put('/seg/load/')
# TODO: optionally let client name model
def load_px_model(params: ilm.IlastikPixelClassifierParams) -> dict:
return load_ilastik_model(
ilm.IlastikPixelClassifierModel,
......
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