interactive-pipe 0.7.8__tar.gz → 0.8.0__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.7.8/src/interactive_pipe.egg-info → interactive_pipe-0.8.0}/PKG-INFO +2 -2
  2. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/pyproject.toml +1 -1
  3. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/readme.md +1 -1
  4. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/__init__.py +11 -0
  5. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/data_objects/audio.py +9 -2
  6. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/gradio_gui.py +6 -3
  7. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/pipeline_decorator.py +0 -2
  8. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0/src/interactive_pipe.egg-info}/PKG-INFO +2 -2
  9. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/LICENSE +0 -0
  10. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/setup.cfg +0 -0
  11. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/__init__.py +0 -0
  12. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/cache.py +0 -0
  13. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/engine.py +0 -0
  14. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/filter.py +0 -0
  15. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/graph.py +0 -0
  16. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/pipeline.py +0 -0
  17. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/core/signature.py +0 -0
  18. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/data_objects/__init__.py +0 -0
  19. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/data_objects/curves.py +0 -0
  20. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/data_objects/data.py +0 -0
  21. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/data_objects/image.py +0 -0
  22. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/data_objects/parameters.py +0 -0
  23. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/__init__.py +0 -0
  24. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/gradio_control.py +0 -0
  25. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/gui.py +0 -0
  26. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/mpl_control.py +0 -0
  27. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/mpl_gui.py +0 -0
  28. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/mpl_window.py +0 -0
  29. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/nb_control.py +0 -0
  30. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/nb_gui.py +0 -0
  31. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/qt_control.py +0 -0
  32. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/qt_gui.py +0 -0
  33. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/graphical/window.py +0 -0
  34. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/headless/__init__.py +0 -0
  35. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/headless/control.py +0 -0
  36. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/headless/keyboard.py +0 -0
  37. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/headless/pipeline.py +0 -0
  38. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/__init__.py +0 -0
  39. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/_private.py +0 -0
  40. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/choose_backend.py +0 -0
  41. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/control_abbreviation.py +0 -0
  42. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/filter_decorator.py +0 -0
  43. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/helper/keyword_args_analyzer.py +0 -0
  44. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/thirdparty/images_openai_api.py +0 -0
  45. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe/thirdparty/music_spotify.py +0 -0
  46. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe.egg-info/SOURCES.txt +0 -0
  47. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe.egg-info/dependency_links.txt +0 -0
  48. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe.egg-info/requires.txt +0 -0
  49. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/src/interactive_pipe.egg-info/top_level.txt +0 -0
  50. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_cache.py +0 -0
  51. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_control_abbreviations.py +0 -0
  52. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_controller.py +0 -0
  53. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_core.py +0 -0
  54. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_curves.py +0 -0
  55. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_decorator.py +0 -0
  56. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_engine.py +0 -0
  57. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_filter.py +0 -0
  58. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_headless.py +0 -0
  59. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_image.py +0 -0
  60. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_parameters.py +0 -0
  61. {interactive_pipe-0.7.8 → interactive_pipe-0.8.0}/test/test_recorder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: interactive_pipe
3
- Version: 0.7.8
3
+ Version: 0.8.0
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.7.7**
109
+ **Version 0.8.0**
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.7.8"
8
+ version = "0.8.0"
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.7.7**
65
+ **Version 0.8.0**
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,5 +1,16 @@
1
+ __version__ = "0.8.0"
1
2
  from interactive_pipe.helper.pipeline_decorator import pipeline, interactive_pipeline
2
3
  from interactive_pipe.headless.control import Control, CircularControl
3
4
  from interactive_pipe.data_objects.curves import Curve, SingleCurve
5
+ from interactive_pipe.data_objects.image import Image
4
6
  from interactive_pipe.headless.keyboard import KeyboardControl
5
7
  from interactive_pipe.helper.filter_decorator import interactive, interact
8
+
9
+ # Allowing more straightforward naming convention
10
+ block = interactive
11
+ pipeline = interactive_pipeline
12
+
13
+ # You can usef the following naming convention:
14
+ # import interactive_pipe as ip
15
+ # @ip.block(...)
16
+ # @ip.pipeline(...)
@@ -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, data, sampling_rate)
78
+ wavio.write(path, data_save, sampling_rate)
72
79
  else:
73
80
  raise NotImplementedError(f"Unknown backend: {backend}")
74
81
 
@@ -61,7 +61,7 @@ class InteractivePipeGradio(InteractivePipeGUI):
61
61
  out_list_gradio_containers.append(gr.Audio(label=title))
62
62
  self.window.image_canvas[idx][idy]["type"] = "audio"
63
63
  else:
64
- out_list_gradio_containers.append(gr.Image(label=title))
64
+ out_list_gradio_containers.append(gr.Image(format="png", type="numpy", label=title))
65
65
  self.window.image_canvas[idx][idy]["type"] = "image"
66
66
  elif MPL_SUPPORT and isinstance(out_list[idx][idy], Curve):
67
67
  # if out_list[idx][idy].title is not None:
@@ -85,7 +85,7 @@ class InteractivePipeGradio(InteractivePipeGUI):
85
85
 
86
86
 
87
87
  class MainWindow(InteractivePipeWindow):
88
- def __init__(self, *args, controls=[], name="", pipeline: HeadlessPipeline = None, size=None, share_gradio_app=False, markdown_description=None, sliders_layout=None, sliders_per_row_layout=None, audio=False, audio_sampling_rate: int =44100, **kwargs):
88
+ def __init__(self, *args, controls=[], name="", pipeline: HeadlessPipeline = None, size=None, share_gradio_app=False, markdown_description=None, sliders_layout=None, sliders_per_row_layout=None, audio=False, audio_sampling_rate: int = 44100, **kwargs):
89
89
  InteractivePipeWindow.__init__(
90
90
  self, name=name, pipeline=pipeline, size=size)
91
91
  self.markdown_description = markdown_description
@@ -108,6 +108,9 @@ class MainWindow(InteractivePipeWindow):
108
108
  if out[idx][idy] is None:
109
109
  flat_out.append("")
110
110
  elif MPL_SUPPORT and isinstance(out[idx][idy], Curve):
111
+ # https://github.com/balthazarneveu/interactive_pipe/issues/54
112
+ # Update curves instead of creating new ones shall be faster
113
+ # Gradio still flickers anyway.
111
114
  curve = out[idx][idy]
112
115
  fig, ax = plt.subplots()
113
116
  Curve._plot_curve(curve.data, ax=ax)
@@ -177,7 +180,7 @@ class MainWindow(InteractivePipeWindow):
177
180
  elem = outputs[idy * len(self.image_canvas[idy]) + idx]
178
181
  if elem is not None:
179
182
  elem.render()
180
-
183
+
181
184
  if self.audio:
182
185
  outputs.append(self.audio)
183
186
  with gr.Row():
@@ -5,8 +5,6 @@ import functools
5
5
  from typing import Callable, Union, Optional
6
6
  from interactive_pipe.helper.choose_backend import get_interactive_pipeline_class
7
7
 
8
- None
9
-
10
8
 
11
9
  def pipeline(pipeline_function: Callable, **kwargs) -> HeadlessPipeline:
12
10
  return HeadlessPipeline.from_function(pipeline_function, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: interactive_pipe
3
- Version: 0.7.8
3
+ Version: 0.8.0
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.7.7**
109
+ **Version 0.8.0**
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