interactive-pipe 0.7.9__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {interactive_pipe-0.7.9/src/interactive_pipe.egg-info → interactive_pipe-0.8.1}/PKG-INFO +2 -2
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/pyproject.toml +1 -1
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/readme.md +1 -1
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/__init__.py +1 -1
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/audio.py +9 -2
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gradio_control.py +18 -3
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gradio_gui.py +43 -14
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1/src/interactive_pipe.egg-info}/PKG-INFO +2 -2
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/LICENSE +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/setup.cfg +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/__init__.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/cache.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/engine.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/filter.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/graph.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/pipeline.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/core/signature.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/__init__.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/curves.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/data.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/image.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/parameters.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/__init__.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gui.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_control.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_gui.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_window.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/nb_control.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/nb_gui.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/qt_control.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/qt_gui.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/window.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/__init__.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/control.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/keyboard.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/pipeline.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/__init__.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/_private.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/choose_backend.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/control_abbreviation.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/filter_decorator.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/keyword_args_analyzer.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/pipeline_decorator.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/thirdparty/images_openai_api.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/thirdparty/music_spotify.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/SOURCES.txt +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/dependency_links.txt +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/requires.txt +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/top_level.txt +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_cache.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_control_abbreviations.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_controller.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_core.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_curves.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_decorator.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_engine.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_filter.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_headless.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_image.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_parameters.py +0 -0
- {interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/test/test_recorder.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: interactive_pipe
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Library to create flexible interactive image processing pipelines and automatically add a graphical user interface without knowing anything about GUI coding!
|
|
5
5
|
Author-email: Balthazar Neveu <balthazarneveu@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/balthazarneveu/interactive_pipe
|
|
@@ -106,7 +106,7 @@ pip install -e ".[full]"
|
|
|
106
106
|
|
|
107
107
|
## :scroll: Features
|
|
108
108
|
|
|
109
|
-
**Version 0.
|
|
109
|
+
**Version 0.8.1**
|
|
110
110
|
- Modular multi-image processing filters
|
|
111
111
|
- Declarative: Easily make graphical user interface without having to learn anything about pyQt or matplotlib
|
|
112
112
|
- Support in jupyter notebooks
|
|
@@ -62,7 +62,7 @@ pip install -e ".[full]"
|
|
|
62
62
|
|
|
63
63
|
## :scroll: Features
|
|
64
64
|
|
|
65
|
-
**Version 0.
|
|
65
|
+
**Version 0.8.1**
|
|
66
66
|
- Modular multi-image processing filters
|
|
67
67
|
- Declarative: Easily make graphical user interface without having to learn anything about pyQt or matplotlib
|
|
68
68
|
- Support in jupyter notebooks
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.8.1"
|
|
2
2
|
from interactive_pipe.helper.pipeline_decorator import pipeline, interactive_pipeline
|
|
3
3
|
from interactive_pipe.headless.control import Control, CircularControl
|
|
4
4
|
from interactive_pipe.data_objects.curves import Curve, SingleCurve
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/audio.py
RENAMED
|
@@ -19,7 +19,7 @@ def audio_to_html(audio: Union[None, str, Path, Tuple[int, np.ndarray]], control
|
|
|
19
19
|
logging.debug("No audio to display")
|
|
20
20
|
return ""
|
|
21
21
|
if isinstance(audio, str) or isinstance(audio, Path):
|
|
22
|
-
audio_base64 = base64.b64encode(open(audio, "rb").read()).decode("utf-8")
|
|
22
|
+
audio_base64 = base64.b64encode(open(str(audio), "rb").read()).decode("utf-8")
|
|
23
23
|
elif isinstance(audio, tuple):
|
|
24
24
|
assert WAVIO_AVAILABLE, "wavio is not available"
|
|
25
25
|
assert len(audio) == 2, "audio tuple should have 2 elements: (rate, data)"
|
|
@@ -67,8 +67,15 @@ class Audio(Data):
|
|
|
67
67
|
if backend is None:
|
|
68
68
|
backend = WAVIO
|
|
69
69
|
if backend == WAVIO:
|
|
70
|
+
if isinstance(data, np.ndarray):
|
|
71
|
+
if data.dtype == np.float32 or data.dtype == np.float64:
|
|
72
|
+
data_save = (data * 32767).astype(np.int16)
|
|
73
|
+
elif data.dtype == np.int16:
|
|
74
|
+
data_save = data
|
|
75
|
+
else:
|
|
76
|
+
raise ValueError(f"Data type {data.dtype} not supported")
|
|
70
77
|
assert WAVIO_AVAILABLE, "wavio is not available"
|
|
71
|
-
wavio.write(path,
|
|
78
|
+
wavio.write(path, data_save, sampling_rate)
|
|
72
79
|
else:
|
|
73
80
|
raise NotImplementedError(f"Unknown backend: {backend}")
|
|
74
81
|
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gradio_control.py
RENAMED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
from functools import partial
|
|
3
1
|
from interactive_pipe.headless.control import Control
|
|
4
2
|
import logging
|
|
5
3
|
import gradio as gr
|
|
@@ -31,7 +29,7 @@ class ControlFactory:
|
|
|
31
29
|
bool: TickBoxControl,
|
|
32
30
|
int: IntSliderControl,
|
|
33
31
|
float: FloatSliderControl,
|
|
34
|
-
str: DropdownMenuControl
|
|
32
|
+
str: DropdownMenuControl if control.icons is None else IconButtonsControl
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
if control_type not in control_class_map:
|
|
@@ -101,3 +99,20 @@ class DropdownMenuControl(BaseControl):
|
|
|
101
99
|
if index >= 0:
|
|
102
100
|
self.control_widget.setCurrentIndex(index)
|
|
103
101
|
self.control_widget.setCurrentIndex(index)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class IconButtonsControl(BaseControl):
|
|
105
|
+
def check_control_type(self):
|
|
106
|
+
assert self.ctrl._type == str
|
|
107
|
+
if not hasattr(self.ctrl, 'value_range'):
|
|
108
|
+
raise ValueError("Invalid control type")
|
|
109
|
+
|
|
110
|
+
def create(self) -> gr.Radio:
|
|
111
|
+
self.control_widget = []
|
|
112
|
+
for idx, icon in enumerate(self.ctrl.icons):
|
|
113
|
+
# text = self.ctrl.value_range[idx]
|
|
114
|
+
text = ""
|
|
115
|
+
self.control_widget.append(
|
|
116
|
+
gr.Button(text, icon=self.ctrl.icons[idx])
|
|
117
|
+
)
|
|
118
|
+
return self.control_widget
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gradio_gui.py
RENAMED
|
@@ -147,7 +147,10 @@ class MainWindow(InteractivePipeWindow):
|
|
|
147
147
|
out_tuple = process_outputs_fn(out)
|
|
148
148
|
if self.audio:
|
|
149
149
|
html_audio = audio_to_html(self.audio_content)
|
|
150
|
-
|
|
150
|
+
if isinstance(out_tuple, tuple):
|
|
151
|
+
return *out_tuple, html_audio
|
|
152
|
+
else:
|
|
153
|
+
return out_tuple, html_audio
|
|
151
154
|
return out_tuple
|
|
152
155
|
self.default_values = [self.ctrl[ctrl_key].value for ctrl_key in self.ctrl.keys()]
|
|
153
156
|
self.process_inputs_fn = process_inputs_fn
|
|
@@ -221,9 +224,14 @@ class MainWindow(InteractivePipeWindow):
|
|
|
221
224
|
continue
|
|
222
225
|
if self.sliders_per_row_layout == 1:
|
|
223
226
|
with selected_mode:
|
|
224
|
-
for idx in
|
|
225
|
-
|
|
226
|
-
|
|
227
|
+
for idx in range(len(self.widget_list)):
|
|
228
|
+
if isinstance(self.widget_list[idx], list):
|
|
229
|
+
with gr.Row():
|
|
230
|
+
for elem in self.widget_list[idx]:
|
|
231
|
+
elem.render()
|
|
232
|
+
else:
|
|
233
|
+
elem = self.widget_list[idx]
|
|
234
|
+
elem.render()
|
|
227
235
|
else:
|
|
228
236
|
with selected_mode:
|
|
229
237
|
for split_num in range(math.ceil(len(ctrl_indices)/self.sliders_per_row_layout)):
|
|
@@ -233,10 +241,17 @@ class MainWindow(InteractivePipeWindow):
|
|
|
233
241
|
for idx in ctrl_indices[start:end]:
|
|
234
242
|
elem = self.widget_list[idx]
|
|
235
243
|
elem.render()
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
244
|
+
changing_inputs = []
|
|
245
|
+
discard_reset_button = False
|
|
246
|
+
for idx in range(len(self.widget_list)):
|
|
247
|
+
if isinstance(self.widget_list[idx], list):
|
|
248
|
+
changing_inputs.append(gr.State(self.ctrl[list(self.ctrl.keys())[idx]].value_default))
|
|
249
|
+
discard_reset_button = True # Do not show reset button if there are lists of buttons
|
|
250
|
+
else:
|
|
251
|
+
changing_inputs.append(self.widget_list[idx])
|
|
252
|
+
if not discard_reset_button:
|
|
253
|
+
with gr.Accordion("Reset to default values", open=False):
|
|
254
|
+
gr.Examples([self.default_values], inputs=changing_inputs, label="Presets")
|
|
240
255
|
if self.markdown_description is not None:
|
|
241
256
|
title = "Description"
|
|
242
257
|
try:
|
|
@@ -246,13 +261,27 @@ class MainWindow(InteractivePipeWindow):
|
|
|
246
261
|
pass
|
|
247
262
|
with gr.Accordion(title, open=False):
|
|
248
263
|
gr.Markdown(self.markdown_description)
|
|
249
|
-
io.load(fn=self.run_fn, inputs=
|
|
264
|
+
io.load(fn=self.run_fn, inputs=changing_inputs, outputs=outputs)
|
|
250
265
|
for idx in range(len(self.widget_list)):
|
|
251
|
-
self.widget_list[idx]
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
if isinstance(self.widget_list[idx], list):
|
|
267
|
+
for idy, elem in enumerate(self.widget_list[idx]):
|
|
268
|
+
changing_inputs_copy = changing_inputs.copy()
|
|
269
|
+
changing_inputs_copy[idx] = gr.State(
|
|
270
|
+
self.ctrl[list(self.ctrl.keys())[idx]].value_range[idy])
|
|
271
|
+
elem.click(
|
|
272
|
+
fn=self.run_fn,
|
|
273
|
+
inputs=changing_inputs_copy,
|
|
274
|
+
outputs=outputs,
|
|
275
|
+
show_progress="minimal"
|
|
276
|
+
)
|
|
277
|
+
else:
|
|
278
|
+
self.widget_list[idx].change(
|
|
279
|
+
fn=self.run_fn,
|
|
280
|
+
inputs=changing_inputs,
|
|
281
|
+
outputs=outputs,
|
|
282
|
+
show_progress="minimal"
|
|
283
|
+
)
|
|
284
|
+
|
|
256
285
|
self.io = io
|
|
257
286
|
self.io.launch(share=self.share_gradio_app)
|
|
258
287
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: interactive_pipe
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Library to create flexible interactive image processing pipelines and automatically add a graphical user interface without knowing anything about GUI coding!
|
|
5
5
|
Author-email: Balthazar Neveu <balthazarneveu@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/balthazarneveu/interactive_pipe
|
|
@@ -106,7 +106,7 @@ pip install -e ".[full]"
|
|
|
106
106
|
|
|
107
107
|
## :scroll: Features
|
|
108
108
|
|
|
109
|
-
**Version 0.
|
|
109
|
+
**Version 0.8.1**
|
|
110
110
|
- Modular multi-image processing filters
|
|
111
111
|
- Declarative: Easily make graphical user interface without having to learn anything about pyQt or matplotlib
|
|
112
112
|
- Support in jupyter notebooks
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/__init__.py
RENAMED
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/curves.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/image.py
RENAMED
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/parameters.py
RENAMED
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_control.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_window.py
RENAMED
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/nb_control.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/qt_control.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/choose_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/filter_decorator.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/pipeline_decorator.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe/thirdparty/music_spotify.py
RENAMED
|
File without changes
|
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/requires.txt
RENAMED
|
File without changes
|
{interactive_pipe-0.7.9 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|