diff --git a/image_prediction/pipeline.py b/image_prediction/pipeline.py index 6d29ac7..e8114b8 100644 --- a/image_prediction/pipeline.py +++ b/image_prediction/pipeline.py @@ -48,6 +48,7 @@ class Pipeline: split = compose(star(parallel(*map(lift, (first, first, second)))), rpartial(tee, 3)) classify = compose(chain.from_iterable, lift(classifier), partial(chunks, batch_size)) pairwise_apply = compose(star, parallel) + # TODO: use signal compress join = compose(starlift(lambda prd, rpr, mdt: {"classification": prd, **mdt, "representation": rpr}), star(zip)) # />--classify--\ diff --git a/image_prediction/redai_adapter/model.py b/image_prediction/redai_adapter/model.py index c5450f5..fabcb78 100644 --- a/image_prediction/redai_adapter/model.py +++ b/image_prediction/redai_adapter/model.py @@ -9,6 +9,7 @@ class PredictionModelHandle: """Simplifies usage of ModelHandle instances for prediction purposes.""" def __init__(self, model_handle): + # TODO: extract signal self.__predict = rcompose(model_handle.prep_images, model_handle.model.predict) def predict(self, *args, **kwargs): diff --git a/image_prediction/redai_adapter/model_wrapper.py b/image_prediction/redai_adapter/model_wrapper.py index 776931e..89aa49b 100644 --- a/image_prediction/redai_adapter/model_wrapper.py +++ b/image_prediction/redai_adapter/model_wrapper.py @@ -32,6 +32,7 @@ class ModelWrapper(abc.ABC): def prep_images(self, images): images = map(self.__resize_and_convert, images) + # TODO: signal, images = ... tensor = self.__images_to_tensor(images) tensor = self.__preprocess_tensor(tensor) diff --git a/image_prediction/stitching/merging.py b/image_prediction/stitching/merging.py index 2c3fbc4..7f4442c 100644 --- a/image_prediction/stitching/merging.py +++ b/image_prediction/stitching/merging.py @@ -184,6 +184,7 @@ def concat_images(im1: Image, im2: Image, metadata: dict, axis): for im, offset in zip(images, offsets): box = (offset, 0) if not axis else (0, offset) + # TODO: replace image that cannot be opened with white image of same size im_aggr.paste(im, box=box) return im_aggr