🧱 Define processing blocks as regular functions.

Define each atomic processing block as a regular python function.

2 kinds of elements are fed into each processing block:

➑️ Arguments are signal buffers (numpy arrays).

➑️ Keyword arguments are default parameters (float, int, bool, str).

β†ͺ️ Function can return several signal buffers (numpy arrays).

import numpy as np
# --- Define processing blocks ---
def gen_color(green=1., decay=2):
    t = np.linspace(0., 1., 256)
    X, Y = np.meshgrid(np.exp(-t*decay), t)
    return np.stack([X, green*Y, Y[::-1]], -1)

def flip_img(img, flip=True):
    out = img[::-1] if flip else img.copy()
    return out, img[:, ::-1]

def amplify(img, amp="L"):
    ratio = {"S":4, "M":3, "L": 2, XL":1}[amp]
    return 1/ratio*img
          

πŸ”— Define a pipeline and output layout.

πŸ”€ Chain processing blocks to define a pipeline.

πŸͺŸ Output layout is specified by the return statement.

return [A, B, C] return [[A, B], [C, D]] return [[A], [B]]
A B C A B C D A B
# --- Define pipeline ---
def pipe():
    inp = gen_color()
    out_flip, out_mirror = flip_img(inp)
    out = amplify(out_mirror)
    return [inp, out_flip, out]
    # Display 3 images side by side
      

πŸ•ΉοΈ Add controls to processing blocks.

🎚️ By decorating a processing block, Interactive pipe adds controls.

πŸ‘‰ Controls are automatically created for each keyword argument.

string boolean integer float
Amplify
Flip
Color Decay
3
Green amount
0.5
import interactive_pipe  as ip
# --- Decorate processing blocks --- 
ip.interactive(
  green=(1., [0., 1.], "Green amount"),
  decay=(2 , [0 , 10], "Color decay")
)(gen_color)
ip.interactive(
  amp=("L", ["S", "M", "L", "XL"], "Amplify")
)(amplify)
ip.interactive(flip=(True, "Flip"))(flip_img)

▢️ Launch interactive pipe.

🎯 Interactive Pipe deals with several graphical interfaces backends.

πŸ’« No code changes needed: Same GUI, no matter the backend .

# --- Decorate pipeline & run --- 
ip.interactive_pipeline(gui="qt")(pipe)()

🎁 Multiple backends support

Interactive Pipe offers a range of options for displaying your code, no code changes needed.

πŸ’» PyQT

βœ… Dynamic control of output layouts.

βœ… Keyboard shortcuts, Full screen.

βœ… Audio Playback.

Sample python code on github »
Open on GitHub

⌨️ Ideal during development, debug sessions and code reviews.

πŸ€— Gradio

βœ… Share your pipeline with others.

βœ… Easily host in Hugging Face spaces.

βœ… Runs in a browser.

Example: Basic Image editing »
Open In HF

πŸ§ͺ Ideal to share ideas inside a scientific team, ready for demos.

πŸ“’ Notebooks

βœ… Annotate with markdown and equations.

βœ… Easily host on Google Colab.

βœ… Based on Jupyter IPywidget.

Example: Signal processing notebook »
Open In Colab

πŸ§‘β€πŸŽ“ Ideal for students projects (computer vision, machine learning).



πŸš€ Features

πŸ“ˆ πŸ“· Images and Curves are supported by Interactive Pipe.

🎢 🎧 Live audio playback is supported using Qt and Gradio GUI.

🏍️ πŸ’Ύ A cache mechanism allows skipping computation if the inputs and sliders have not changed.


βœ”οΈ Motivations

✊ Empower engineers and developers to showcase their expertise.

πŸ” Visual debugging made intuitive: Traditional debugging tools often fall short for image and audio algorithms, where simple breakpoints aren't enough. Visual tools provide clearer insights.

πŸ§‘β€βš–οΈ Elevate code reviews: Go beyond unit testsβ€”demonstrate your code's functionality visually, making it easier to convince peers that it works as expected.

🏭 Seamless production integration: Maintain a clean separation between production code and graphical interfaces. By decorating processing blocks in a dedicated file, your pipeline remain functional whether run in a GUI or headlessly via the command line.

πŸ”¬ Built by scientists, for scientists. Designed with research-driven workflows in mind.


πŸ’₯ Real use cases

🧸 Tutorial is written as a comprehensive toy example (to understand the concept).

🏭 But Interactive Pipe can be used on real use cases.

πŸš€ Check by yourself with the examples provided on Image, Audio and Machine learning.


πŸŽ“ Tutorials

πŸ”— Many tutorials are available from basic to advanced features of interactive pipe.


πŸ™ Acknowledgement

- Main contributor: Balthazar Neveu

- Additional contributors: Emmanuel Chaboud, Giuseppe Moschetti, Sylvain Leroy

- Additional testers: Jamy Lafenetre, Mathilde Dupouy, Matthieu Dinot