interactive-pipe 0.8.0__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.
Files changed (61) hide show
  1. {interactive_pipe-0.8.0/src/interactive_pipe.egg-info → interactive_pipe-0.8.1}/PKG-INFO +2 -2
  2. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/pyproject.toml +1 -1
  3. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/readme.md +1 -1
  4. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/__init__.py +1 -1
  5. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gradio_control.py +18 -3
  6. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gradio_gui.py +43 -14
  7. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1/src/interactive_pipe.egg-info}/PKG-INFO +2 -2
  8. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/LICENSE +0 -0
  9. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/setup.cfg +0 -0
  10. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/__init__.py +0 -0
  11. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/cache.py +0 -0
  12. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/engine.py +0 -0
  13. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/filter.py +0 -0
  14. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/graph.py +0 -0
  15. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/pipeline.py +0 -0
  16. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/core/signature.py +0 -0
  17. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/__init__.py +0 -0
  18. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/audio.py +0 -0
  19. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/curves.py +0 -0
  20. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/data.py +0 -0
  21. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/image.py +0 -0
  22. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/data_objects/parameters.py +0 -0
  23. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/__init__.py +0 -0
  24. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/gui.py +0 -0
  25. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_control.py +0 -0
  26. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_gui.py +0 -0
  27. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/mpl_window.py +0 -0
  28. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/nb_control.py +0 -0
  29. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/nb_gui.py +0 -0
  30. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/qt_control.py +0 -0
  31. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/qt_gui.py +0 -0
  32. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/graphical/window.py +0 -0
  33. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/__init__.py +0 -0
  34. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/control.py +0 -0
  35. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/keyboard.py +0 -0
  36. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/headless/pipeline.py +0 -0
  37. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/__init__.py +0 -0
  38. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/_private.py +0 -0
  39. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/choose_backend.py +0 -0
  40. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/control_abbreviation.py +0 -0
  41. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/filter_decorator.py +0 -0
  42. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/keyword_args_analyzer.py +0 -0
  43. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/helper/pipeline_decorator.py +0 -0
  44. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/thirdparty/images_openai_api.py +0 -0
  45. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe/thirdparty/music_spotify.py +0 -0
  46. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/SOURCES.txt +0 -0
  47. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/dependency_links.txt +0 -0
  48. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/requires.txt +0 -0
  49. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/src/interactive_pipe.egg-info/top_level.txt +0 -0
  50. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_cache.py +0 -0
  51. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_control_abbreviations.py +0 -0
  52. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_controller.py +0 -0
  53. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_core.py +0 -0
  54. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_curves.py +0 -0
  55. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_decorator.py +0 -0
  56. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_engine.py +0 -0
  57. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_filter.py +0 -0
  58. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_headless.py +0 -0
  59. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_image.py +0 -0
  60. {interactive_pipe-0.8.0 → interactive_pipe-0.8.1}/test/test_parameters.py +0 -0
  61. {interactive_pipe-0.8.0 → 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.8.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.8.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
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "interactive_pipe"
8
- version = "0.8.0"
8
+ version = "0.8.1"
9
9
  authors = [
10
10
  { name="Balthazar Neveu", email="balthazarneveu@gmail.com" },
11
11
  ]
@@ -62,7 +62,7 @@ pip install -e ".[full]"
62
62
 
63
63
  ## :scroll: Features
64
64
 
65
- **Version 0.8.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.8.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
@@ -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
@@ -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
- return *out_tuple, html_audio
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 ctrl_indices:
225
- elem = self.widget_list[idx]
226
- elem.render()
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
- with gr.Accordion("Reset to default values", open=False):
238
- gr.Examples([self.default_values], inputs=self.widget_list, label="Presets")
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=self.widget_list, outputs=outputs)
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].change(
252
- fn=self.run_fn, inputs=self.widget_list,
253
- outputs=outputs,
254
- show_progress="minimal"
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.8.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.8.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