P6-AAU-23 / consumer-client

0 stars 0 forks source link

Include the option to change the mode of the different steps in the pipeline #62

Closed CasperStaahl closed 1 year ago

CasperStaahl commented 1 year ago

Thought about this issue today, and had these two conversations with ChatGPT4:

My general idea is to remove the Pipeline class, and instead create a function:

type Pipeline = Image -> Image 
pipeline_builder :: Args -> Pipeline

This function should make use of the monoid pattern from Haskell (see second conversation with GPT), plus another function. This means that `pipeline_builder would mainly use 4 different functions explained below to compose the pipeline.

append :: Pipeline -> Pipeline
concat :: [Pipeline] -> Pipeline
merge :: Pipeline -> Pipeline -> (Image -> Image -> Image) -> Pipeline
split :: Pipeline -> (Pipeline, Pipeline)

append and concat are self explanatory, Merge would take two Pipelines and and function for how they should merge (Image -> Image -> Image) and return the merged Pipeline. Split would split the pipeline in two.

Image

CasperStaahl commented 1 year ago

If we want to be even more crazy we define a little language such that you could write something like:

--pipline=warp_perspective->{remove_foreground, idealize_colors)->inpainter

But that is probably taking it too far 🙃

TerranAster commented 1 year ago

For backburner: If we expand on "color_idealize modes", use strategy pattern