From 6c10b55ff8e61412cb2fe5a5625e660ecaf1d7d1 Mon Sep 17 00:00:00 2001 From: Matthias Bisping Date: Thu, 21 Apr 2022 19:48:05 +0200 Subject: [PATCH] refactoring --- image_prediction/pipeline.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/image_prediction/pipeline.py b/image_prediction/pipeline.py index 0be6b55..7bf84b5 100644 --- a/image_prediction/pipeline.py +++ b/image_prediction/pipeline.py @@ -35,9 +35,6 @@ class Pipeline: def join_prediction_and_metadata(prd, mdt): return {"classification": prd, **mdt} - def process_batch(batch): - classifications, metadata = juxt(left, right)(batch) - return starmap(join_prediction_and_metadata, zip(classifications, metadata)) # -------- # -- -- -- -- @@ -55,7 +52,9 @@ class Pipeline: self.pipe = rcompose( extractor, batcher, - lift(process_batch), + lift(juxt(left, right)), + starlift(zip), + lift(starlift(join_prediction_and_metadata)), chain.from_iterable, formatter, )