cutcutcodec 1.1.3__tar.gz → 1.2.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.
- {cutcutcodec-1.1.3/cutcutcodec.egg-info → cutcutcodec-1.2.1}/PKG-INFO +5 -15
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/README.rst +1 -2
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/__init__.py +1 -1
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/__main__.py +0 -2
- cutcutcodec-1.2.1/cutcutcodec/config/__init__.py +7 -0
- cutcutcodec-1.2.1/cutcutcodec/config/config.py +97 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/container.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/frame_video.py +33 -96
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/node.py +0 -16
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/stream_video.py +2 -28
- cutcutcodec-1.2.1/cutcutcodec/core/colorspace/__init__.py +61 -0
- cutcutcodec-1.1.3/cutcutcodec/core/filter/video/colorspace_cst.py → cutcutcodec-1.2.1/cutcutcodec/core/colorspace/cst.py +79 -36
- cutcutcodec-1.1.3/cutcutcodec/core/filter/video/colorspace.py → cutcutcodec-1.2.1/cutcutcodec/core/colorspace/func.py +100 -134
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/ast_to_file.py +46 -13
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +28 -1
- cutcutcodec-1.2.1/cutcutcodec/core/compilation/sympy_to_torch/memory_check.py +54 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/sympy_to_torch/printer.py +19 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/sympy_to_torch/printer_atom.py +31 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/factor/proba.py +1 -1
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/exceptions.py +1 -1
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/add.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/cat.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/cut.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/delay.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/equation.py +1 -6
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/fir.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/resample.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/subclip.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/wiener.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/identity.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/add.py +22 -29
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/cat.py +0 -5
- cutcutcodec-1.2.1/cutcutcodec/core/filter/video/colorspace.py +79 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/cut.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/delay.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/equation.py +12 -17
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/pad.py +29 -30
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/patch.py +24 -25
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/resize.py +84 -93
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/speed.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/subclip.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/audio/empty.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/audio/equation.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/audio/noise.py +0 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/video/empty.py +0 -5
- cutcutcodec-1.2.1/cutcutcodec/core/generation/video/equation.py +104 -0
- cutcutcodec-1.2.1/cutcutcodec/core/generation/video/fractal/fractal.c +378 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/video/fractal/mandelbrot.py +24 -28
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/video/noise.py +13 -18
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/__init__.py +27 -14
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/pix_map.py +1 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/read_ffmpeg.py +10 -11
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/read_ffmpeg_color.py +20 -27
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/read_image.py +103 -34
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/read_svg.py +13 -21
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/write_ffmpeg.py +7 -38
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/dataaug/image.py +1 -1
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/loader.py +5 -5
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/abstract.py +0 -47
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/c_memory.py +28 -4
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/colorspace.py +13 -13
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/filter_empty.py +0 -13
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/initialisation.py +0 -7
- cutcutcodec-1.2.1/cutcutcodec/testing/tests/mandelbrot.py +90 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/nan_snapshot.py +3 -3
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/video_equation.py +1 -1
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/write.py +1 -1
- cutcutcodec-1.2.1/cutcutcodec/utils.py +100 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1/cutcutcodec.egg-info}/PKG-INFO +5 -15
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec.egg-info/SOURCES.txt +7 -74
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec.egg-info/entry_points.txt +0 -3
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec.egg-info/requires.txt +2 -12
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/pyproject.toml +2 -16
- cutcutcodec-1.1.3/cutcutcodec/core/generation/video/equation.py +0 -109
- cutcutcodec-1.1.3/cutcutcodec/core/generation/video/fractal/fractal.c +0 -116
- cutcutcodec-1.1.3/cutcutcodec/gui/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/__main__.py +0 -26
- cutcutcodec-1.1.3/cutcutcodec/gui/actions.py +0 -64
- cutcutcodec-1.1.3/cutcutcodec/gui/app/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/app/app.py +0 -248
- cutcutcodec-1.1.3/cutcutcodec/gui/base.py +0 -50
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py +0 -62
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_audio_delay.py +0 -9
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py +0 -45
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_audio_fir.py +0 -58
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py +0 -9
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_cut.py +0 -82
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_delay.py +0 -20
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_subclip.py +0 -21
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_video_delay.py +0 -9
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py +0 -53
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_video_resize.py +0 -19
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py +0 -9
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py +0 -14
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py +0 -19
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py +0 -13
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py +0 -60
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py +0 -18
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/base.py +0 -102
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/default.py +0 -27
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/documentation.py +0 -47
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/general.py +0 -71
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/interface.py +0 -389
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/loader.py +0 -41
- cutcutcodec-1.1.3/cutcutcodec/gui/edit_node_state/main.py +0 -62
- cutcutcodec-1.1.3/cutcutcodec/gui/edition_tabs.py +0 -34
- cutcutcodec-1.1.3/cutcutcodec/gui/entry/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/entry/base.py +0 -122
- cutcutcodec-1.1.3/cutcutcodec/gui/entry/filters.py +0 -42
- cutcutcodec-1.1.3/cutcutcodec/gui/entry/generators.py +0 -42
- cutcutcodec-1.1.3/cutcutcodec/gui/entry_tabs.py +0 -46
- cutcutcodec-1.1.3/cutcutcodec/gui/export/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/export/_helper.py +0 -54
- cutcutcodec-1.1.3/cutcutcodec/gui/export/container.py +0 -227
- cutcutcodec-1.1.3/cutcutcodec/gui/export/doc.py +0 -68
- cutcutcodec-1.1.3/cutcutcodec/gui/export/encodec.py +0 -289
- cutcutcodec-1.1.3/cutcutcodec/gui/export/main.py +0 -173
- cutcutcodec-1.1.3/cutcutcodec/gui/flowchart/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/flowchart/edge_properties.py +0 -60
- cutcutcodec-1.1.3/cutcutcodec/gui/flowchart/main.py +0 -278
- cutcutcodec-1.1.3/cutcutcodec/gui/flowchart/node.py +0 -45
- cutcutcodec-1.1.3/cutcutcodec/gui/main.py +0 -151
- cutcutcodec-1.1.3/cutcutcodec/gui/menu.py +0 -21
- cutcutcodec-1.1.3/cutcutcodec/gui/preferences/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/preferences/audio_settings.py +0 -185
- cutcutcodec-1.1.3/cutcutcodec/gui/preferences/main.py +0 -41
- cutcutcodec-1.1.3/cutcutcodec/gui/preferences/video_settings.py +0 -258
- cutcutcodec-1.1.3/cutcutcodec/gui/run.py +0 -71
- cutcutcodec-1.1.3/cutcutcodec/gui/timeline/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/timeline/main.py +0 -30
- cutcutcodec-1.1.3/cutcutcodec/gui/timeline/slider.py +0 -286
- cutcutcodec-1.1.3/cutcutcodec/gui/timeline/track.py +0 -97
- cutcutcodec-1.1.3/cutcutcodec/gui/timeline/view.py +0 -94
- cutcutcodec-1.1.3/cutcutcodec/gui/toolbar.py +0 -29
- cutcutcodec-1.1.3/cutcutcodec/gui/tools.py +0 -23
- cutcutcodec-1.1.3/cutcutcodec/gui/video_preview/__init__.py +0 -3
- cutcutcodec-1.1.3/cutcutcodec/gui/video_preview/audio_player.py +0 -103
- cutcutcodec-1.1.3/cutcutcodec/gui/video_preview/control.py +0 -96
- cutcutcodec-1.1.3/cutcutcodec/gui/video_preview/frame_extractor.py +0 -254
- cutcutcodec-1.1.3/cutcutcodec/gui/video_preview/main.py +0 -116
- cutcutcodec-1.1.3/cutcutcodec/testing/generation.py +0 -52
- cutcutcodec-1.1.3/cutcutcodec/testing/tests/compile.py +0 -43
- cutcutcodec-1.1.3/cutcutcodec/testing/tests/hashes.py +0 -23
- cutcutcodec-1.1.3/cutcutcodec/testing/tests/serialization_equality.py +0 -51
- cutcutcodec-1.1.3/cutcutcodec/testing/tests/snapshot_shape.py +0 -22
- cutcutcodec-1.1.3/cutcutcodec/testing/tests/time_range.py +0 -55
- cutcutcodec-1.1.3/cutcutcodec/utils.py +0 -48
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/LICENSE +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/c_build.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/_helper_properties.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/audio/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/audio/properties/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/audio/properties/duration.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/ffprobe.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/graph/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/graph/find.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/graph/time_backprop.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/stream/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/stream/rate_audio.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/stream/rate_video.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/stream/shape.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/stream/time_backprop.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/video/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/video/properties/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/video/properties/duration.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/video/properties/nb_frames.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/video/properties/rate.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/analysis/video/properties/timestamps.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/encoder.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/filter.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/frame.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/frame_audio.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/layout.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/meta_filter.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/muxer.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/stream.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/classes/stream_audio.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/export/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/export/compatibility.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/export/default.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/export/encodec.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/export/muxer.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/export/rate.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/graph_to_ast.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/graph_to_json.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/graph_to_tree.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/json_to_graph.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/parse.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/compilation/tree_to_graph.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/decision/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/factor/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/generalize/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/generalize/delay_to_fir.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/operation/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/operation/add.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/edit/operation/remove.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/audio/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/cut.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/mix/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/mix/audio_cast.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/mix/video_cast.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/subclip.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/filter/video/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/audio/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/video/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/video/fractal/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/generation/video/fractal/geometry.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/interfaces/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/interfaces/seedable.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/io/scheduler.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/dataaug/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/model/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/model/compression/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/nn/model/compression/img_cgavaenn.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/basic.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/clean/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/clean/graph.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/hashes/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/hashes/graph.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cache/singleton.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/cuda/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/graph.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/parallel/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/parallel/buffer.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/opti/utils.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/signal/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/signal/psd.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/core/signal/window.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/examples/intro.webm +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/examples/logo.png +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/examples/logo.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/examples/project.json +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/examples/video.mp4 +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/__init__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/__main__.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/coding_style.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/install.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/run.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/audio_cast.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/audio_equation.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/compatibility.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/encoder.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/filter_cut.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/filter_delay.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/fir.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/muxer.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/pad.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/read.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/sympy_to_torch.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec/testing/tests/thread_safe.py +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec.egg-info/dependency_links.txt +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/cutcutcodec.egg-info/top_level.txt +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/docs/build/html/_static/check-solid.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/docs/build/html/_static/copy-button.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/docs/build/html/_static/css/fonts/fontawesome-webfont.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/docs/build/html/_static/nbsphinx-broken-thumbnail.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/docs/build/html/_static/nbsphinx-no-thumbnail.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/media/logo.svg +0 -0
- {cutcutcodec-1.1.3 → cutcutcodec-1.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: cutcutcodec
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: video editing software
|
|
5
5
|
Author-email: "Robin RICHARD (robinechuca)" <serveurpython.oz@gmail.com>
|
|
6
6
|
Maintainer-email: "Robin RICHARD (robinechuca)" <serveurpython.oz@gmail.com>
|
|
@@ -15,7 +15,7 @@ License: Copyright © 2023 Robin RICHARD
|
|
|
15
15
|
Project-URL: Homepage, https://framagit.org/robinechuca/cutcutcodec/-/blob/main/README.rst
|
|
16
16
|
Project-URL: Documentation, https://cutcutcodec.readthedocs.io/latest/
|
|
17
17
|
Project-URL: Repository, https://framagit.org/robinechuca/cutcutcodec/
|
|
18
|
-
Keywords: audio,effect,equation,ffmpeg,filtering,fractal,graph,
|
|
18
|
+
Keywords: audio,effect,equation,ffmpeg,filtering,fractal,graph,movie,open source,video editing
|
|
19
19
|
Classifier: Development Status :: 5 - Production/Stable
|
|
20
20
|
Classifier: Environment :: GPU
|
|
21
21
|
Classifier: Environment :: X11 Applications :: Qt
|
|
@@ -63,29 +63,20 @@ Requires-Dist: sympy>=1.10
|
|
|
63
63
|
Requires-Dist: torch>=2.1
|
|
64
64
|
Requires-Dist: tqdm
|
|
65
65
|
Requires-Dist: unidecode
|
|
66
|
+
Requires-Dist: wand
|
|
66
67
|
Provides-Extra: doc
|
|
67
68
|
Requires-Dist: ipykernel; extra == "doc"
|
|
68
69
|
Requires-Dist: mathjax; extra == "doc"
|
|
69
70
|
Requires-Dist: nbsphinx; extra == "doc"
|
|
70
71
|
Requires-Dist: pandoc; extra == "doc"
|
|
71
|
-
Requires-Dist: qtpy; extra == "doc"
|
|
72
|
-
Requires-Dist: qtpynodeeditor>=0.3.1; extra == "doc"
|
|
73
72
|
Requires-Dist: recommonmark; extra == "doc"
|
|
74
|
-
Requires-Dist: sphinx; extra == "doc"
|
|
73
|
+
Requires-Dist: sphinx==7.4.7; extra == "doc"
|
|
75
74
|
Requires-Dist: sphinx-copybutton; extra == "doc"
|
|
76
75
|
Requires-Dist: sphinx-inline-tabs; extra == "doc"
|
|
77
76
|
Requires-Dist: sphinx-rtd-dark-mode; extra == "doc"
|
|
78
77
|
Requires-Dist: sphinx-rtd-theme; extra == "doc"
|
|
79
78
|
Requires-Dist: sphinxcontrib-video; extra == "doc"
|
|
80
79
|
Requires-Dist: sphinxext-opengraph; extra == "doc"
|
|
81
|
-
Provides-Extra: gui
|
|
82
|
-
Requires-Dist: matplotlib; extra == "gui"
|
|
83
|
-
Requires-Dist: notebook; extra == "gui"
|
|
84
|
-
Requires-Dist: pdoc3; extra == "gui"
|
|
85
|
-
Requires-Dist: pyqt6; extra == "gui"
|
|
86
|
-
Requires-Dist: pyqtgraph>=0.3.1; extra == "gui"
|
|
87
|
-
Requires-Dist: qtpy; extra == "gui"
|
|
88
|
-
Requires-Dist: qtpynodeeditor>=0.3.1; extra == "gui"
|
|
89
80
|
Provides-Extra: test
|
|
90
81
|
Requires-Dist: pydocstyle<=6.1.1; extra == "test"
|
|
91
82
|
Requires-Dist: pylama[all,toml]; extra == "test"
|
|
@@ -130,8 +121,7 @@ Useful links:
|
|
|
130
121
|
Description
|
|
131
122
|
===========
|
|
132
123
|
|
|
133
|
-
This **video editing software** has
|
|
134
|
-
It has been designed for speed and to implement some effects that are hard to find elsewhere.
|
|
124
|
+
This **video editing software** has been designed for speed and to implement some effects that are hard to find elsewhere.
|
|
135
125
|
The kernel is written in python and C, so it's easy to integrate it in your own project (module ``cutcutcodec.core``).
|
|
136
126
|
Although it allows you to fine-tune many parameters, it's smart enough to find the settings that are best suited to your project.
|
|
137
127
|
|
|
@@ -37,8 +37,7 @@ Useful links:
|
|
|
37
37
|
Description
|
|
38
38
|
===========
|
|
39
39
|
|
|
40
|
-
This **video editing software** has
|
|
41
|
-
It has been designed for speed and to implement some effects that are hard to find elsewhere.
|
|
40
|
+
This **video editing software** has been designed for speed and to implement some effects that are hard to find elsewhere.
|
|
42
41
|
The kernel is written in python and C, so it's easy to integrate it in your own project (module ``cutcutcodec.core``).
|
|
43
42
|
Although it allows you to fine-tune many parameters, it's smart enough to find the settings that are best suited to your project.
|
|
44
43
|
|
|
@@ -7,7 +7,6 @@ import sys
|
|
|
7
7
|
import click
|
|
8
8
|
|
|
9
9
|
from cutcutcodec import __version__
|
|
10
|
-
from cutcutcodec.gui.__main__ import main as main_gui
|
|
11
10
|
from cutcutcodec.testing.__main__ import main as main_test
|
|
12
11
|
from cutcutcodec.utils import get_project_root
|
|
13
12
|
|
|
@@ -31,7 +30,6 @@ def main(ctx=None, version: bool = False):
|
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
main.add_command(main_test, "test")
|
|
34
|
-
main.add_command(main_gui, "gui")
|
|
35
33
|
|
|
36
34
|
|
|
37
35
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""The main configuration class."""
|
|
4
|
+
|
|
5
|
+
import configparser
|
|
6
|
+
import pathlib
|
|
7
|
+
import typing
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.core.colorspace.cst import PRIMARIES, TRC
|
|
10
|
+
from cutcutcodec.utils import MetaSingleton
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Config(metaclass=MetaSingleton):
|
|
14
|
+
"""Contains all the cutcutcodec configuration parameters.
|
|
15
|
+
|
|
16
|
+
Attributes
|
|
17
|
+
----------
|
|
18
|
+
target_prim : str
|
|
19
|
+
The terminal color primaries.
|
|
20
|
+
target_trc : str
|
|
21
|
+
The terminal color transfere function.
|
|
22
|
+
working_prim : str
|
|
23
|
+
The working space color primaries.
|
|
24
|
+
|
|
25
|
+
Examples
|
|
26
|
+
--------
|
|
27
|
+
>>> import pathlib, tempfile
|
|
28
|
+
>>> from cutcutcodec.config.config import Config
|
|
29
|
+
>>> file = pathlib.Path(tempfile.gettempdir()) / "cutcutcodec.ini"
|
|
30
|
+
>>> with open(file, "w") as raw:
|
|
31
|
+
... _ = raw.write(
|
|
32
|
+
... '''
|
|
33
|
+
... [colorspace]
|
|
34
|
+
... target-prim = bt2020
|
|
35
|
+
... target-trc = smpte2084
|
|
36
|
+
... working-prim = bt2020
|
|
37
|
+
... '''
|
|
38
|
+
... )
|
|
39
|
+
>>> Config(file).working_prim
|
|
40
|
+
'bt2020'
|
|
41
|
+
>>> file.unlink()
|
|
42
|
+
>>>
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
config_file: typing.Union[str, bytes, pathlib.Path] = "~/.config/cutcutcodec/conf.ini"
|
|
48
|
+
):
|
|
49
|
+
"""Initialise the configuration from the file.
|
|
50
|
+
|
|
51
|
+
Parameters
|
|
52
|
+
----------
|
|
53
|
+
config_file : pathlike, default=~/.config/cutcutcodec/conf.ini
|
|
54
|
+
The configuration file.
|
|
55
|
+
"""
|
|
56
|
+
self._config = configparser.ConfigParser()
|
|
57
|
+
self._config["colorspace"] = { # default values
|
|
58
|
+
"target-prim": "bt709",
|
|
59
|
+
"target-trc": "srgb",
|
|
60
|
+
"working-prim": "bt709",
|
|
61
|
+
}
|
|
62
|
+
config_file = pathlib.Path(config_file).expanduser().resolve()
|
|
63
|
+
if config_file.is_file():
|
|
64
|
+
self._config.read(config_file)
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def target_prim(self) -> str:
|
|
68
|
+
"""Return the terminal color primaries."""
|
|
69
|
+
return self._config["colorspace"]["target-prim"]
|
|
70
|
+
|
|
71
|
+
@target_prim.setter
|
|
72
|
+
def target_prim(self, new: str):
|
|
73
|
+
assert isinstance(new, str), new.__class__.__name__
|
|
74
|
+
assert new in PRIMARIES, f"{new} not in {sorted(PRIMARIES)}"
|
|
75
|
+
self._config["colorspace"]["target-prim"] = new
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def target_trc(self) -> str:
|
|
79
|
+
"""Return the terminal color transfere function."""
|
|
80
|
+
return self._config["colorspace"]["target-trc"]
|
|
81
|
+
|
|
82
|
+
@target_trc.setter
|
|
83
|
+
def target_trc(self, new: str):
|
|
84
|
+
assert isinstance(new, str), new.__class__.__name__
|
|
85
|
+
assert new in TRC, f"{new} not in {sorted(TRC)}"
|
|
86
|
+
self._config["colorspace"]["target-trc"] = new
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def working_prim(self) -> str:
|
|
90
|
+
"""Return the working space color primaries."""
|
|
91
|
+
return self._config["colorspace"]["working-prim"]
|
|
92
|
+
|
|
93
|
+
@working_prim.setter
|
|
94
|
+
def working_prim(self, new: str):
|
|
95
|
+
assert isinstance(new, str), new.__class__.__name__
|
|
96
|
+
assert new in PRIMARIES, f"{new} not in {sorted(PRIMARIES)}"
|
|
97
|
+
self._config["colorspace"]["working-prim"] = new
|
|
@@ -30,11 +30,6 @@ class ContainerOutput(Node):
|
|
|
30
30
|
assert state == {}, state
|
|
31
31
|
ContainerOutput.__init__(self, in_streams)
|
|
32
32
|
|
|
33
|
-
@classmethod
|
|
34
|
-
def default(cls):
|
|
35
|
-
"""Provide a minimalist example of an instance of this node."""
|
|
36
|
-
raise NotImplementedError
|
|
37
|
-
|
|
38
33
|
def write(self):
|
|
39
34
|
"""Run the complete assembly graph and exploite the last streams."""
|
|
40
35
|
raise NotImplementedError
|
|
@@ -73,10 +73,10 @@ class FrameVideo(Frame):
|
|
|
73
73
|
--------
|
|
74
74
|
>>> import torch
|
|
75
75
|
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
76
|
-
>>> FrameVideo("2/4", torch.zeros((480, 720, 3)
|
|
77
|
-
FrameVideo('1/2', [[[0
|
|
76
|
+
>>> FrameVideo("2/4", torch.zeros((480, 720, 3))) # doctest: +ELLIPSIS
|
|
77
|
+
FrameVideo('1/2', [[[0., 0., 0.],
|
|
78
78
|
...
|
|
79
|
-
[0
|
|
79
|
+
[0., 0., 0.]]])
|
|
80
80
|
>>>
|
|
81
81
|
"""
|
|
82
82
|
time_str = f"'{self.time}'" if int(self.time) != self.time else f"{self.time}"
|
|
@@ -121,7 +121,7 @@ class FrameVideo(Frame):
|
|
|
121
121
|
assert self.shape[0] > 0, self.shape
|
|
122
122
|
assert self.shape[1] > 0, self.shape
|
|
123
123
|
assert self.shape[2] in {1, 2, 3, 4}, self.shape
|
|
124
|
-
assert self.dtype
|
|
124
|
+
assert self.dtype == torch.float32, self.dtype
|
|
125
125
|
|
|
126
126
|
def convert(self, channels: int) -> Frame:
|
|
127
127
|
"""Change the numbers of channels of the frame.
|
|
@@ -136,10 +136,10 @@ class FrameVideo(Frame):
|
|
|
136
136
|
>>> import torch
|
|
137
137
|
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
138
138
|
>>> _ = torch.manual_seed(0)
|
|
139
|
-
>>> ref_gray = FrameVideo(0, torch.
|
|
140
|
-
>>> ref_gray_alpha = FrameVideo(0, torch.
|
|
141
|
-
>>> ref_bgr = FrameVideo(0, torch.
|
|
142
|
-
>>> ref_bgr_alpha = FrameVideo(0, torch.
|
|
139
|
+
>>> ref_gray = FrameVideo(0, torch.rand((480, 720, 1)))
|
|
140
|
+
>>> ref_gray_alpha = FrameVideo(0, torch.rand((480, 720, 2)))
|
|
141
|
+
>>> ref_bgr = FrameVideo(0, torch.rand((480, 720, 3)))
|
|
142
|
+
>>> ref_bgr_alpha = FrameVideo(0, torch.rand((480, 720, 4)))
|
|
143
143
|
>>>
|
|
144
144
|
>>> # case 1 -> 2, 3, 4
|
|
145
145
|
>>> gray_alpha = ref_gray.convert(2)
|
|
@@ -147,7 +147,7 @@ class FrameVideo(Frame):
|
|
|
147
147
|
2
|
|
148
148
|
>>> torch.equal(gray_alpha[..., 0], ref_gray[..., 0])
|
|
149
149
|
True
|
|
150
|
-
>>> torch.eq(gray_alpha[..., 1],
|
|
150
|
+
>>> torch.eq(gray_alpha[..., 1], 1.0).all()
|
|
151
151
|
tensor(True)
|
|
152
152
|
>>> bgr = ref_gray.convert(3)
|
|
153
153
|
>>> bgr.channels
|
|
@@ -167,7 +167,7 @@ class FrameVideo(Frame):
|
|
|
167
167
|
True
|
|
168
168
|
>>> torch.equal(bgr_alpha[..., 2], ref_gray[..., 0])
|
|
169
169
|
True
|
|
170
|
-
>>> torch.eq(bgr_alpha[..., 3],
|
|
170
|
+
>>> torch.eq(bgr_alpha[..., 3], 1.0).all()
|
|
171
171
|
tensor(True)
|
|
172
172
|
>>>
|
|
173
173
|
>>> # case 2 -> 1, 3, 4
|
|
@@ -175,19 +175,19 @@ class FrameVideo(Frame):
|
|
|
175
175
|
>>> gray.channels
|
|
176
176
|
1
|
|
177
177
|
>>> torch.equal(gray[..., 0],
|
|
178
|
-
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0), 0
|
|
178
|
+
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0.), 0., ref_gray_alpha[..., 0]))
|
|
179
179
|
True
|
|
180
180
|
>>> bgr = ref_gray_alpha.convert(3)
|
|
181
181
|
>>> bgr.channels
|
|
182
182
|
3
|
|
183
183
|
>>> torch.equal(bgr[..., 0],
|
|
184
|
-
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0), 0
|
|
184
|
+
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0.), 0., ref_gray_alpha[..., 0]))
|
|
185
185
|
True
|
|
186
186
|
>>> torch.equal(bgr[..., 1],
|
|
187
|
-
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0), 0
|
|
187
|
+
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0.), 0., ref_gray_alpha[..., 0]))
|
|
188
188
|
True
|
|
189
189
|
>>> torch.equal(bgr[..., 2],
|
|
190
|
-
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0), 0
|
|
190
|
+
... torch.where(torch.eq(ref_gray_alpha[..., 1], 0.), 0., ref_gray_alpha[..., 0]))
|
|
191
191
|
True
|
|
192
192
|
>>> bgr_alpha = ref_gray_alpha.convert(4)
|
|
193
193
|
>>> bgr_alpha.channels
|
|
@@ -208,7 +208,7 @@ class FrameVideo(Frame):
|
|
|
208
208
|
>>> gray_alpha = ref_bgr.convert(2)
|
|
209
209
|
>>> gray_alpha.channels
|
|
210
210
|
2
|
|
211
|
-
>>> torch.eq(gray_alpha[..., 1],
|
|
211
|
+
>>> torch.eq(gray_alpha[..., 1], 1.0).all()
|
|
212
212
|
tensor(True)
|
|
213
213
|
>>> bgr_alpha = ref_bgr.convert(4)
|
|
214
214
|
>>> bgr_alpha.channels
|
|
@@ -219,7 +219,7 @@ class FrameVideo(Frame):
|
|
|
219
219
|
True
|
|
220
220
|
>>> torch.equal(bgr_alpha[..., 2], ref_bgr[..., 2])
|
|
221
221
|
True
|
|
222
|
-
>>> torch.eq(bgr_alpha[..., 3],
|
|
222
|
+
>>> torch.eq(bgr_alpha[..., 3], 1.0).all()
|
|
223
223
|
tensor(True)
|
|
224
224
|
>>>
|
|
225
225
|
>>> # case 4 -> 1, 2, 3
|
|
@@ -235,13 +235,13 @@ class FrameVideo(Frame):
|
|
|
235
235
|
>>> bgr.channels
|
|
236
236
|
3
|
|
237
237
|
>>> torch.equal(bgr[..., 0],
|
|
238
|
-
... torch.where(torch.eq(ref_bgr_alpha[..., 3], 0), 0
|
|
238
|
+
... torch.where(torch.eq(ref_bgr_alpha[..., 3], 0.), 0., ref_bgr_alpha[..., 0]))
|
|
239
239
|
True
|
|
240
240
|
>>> torch.equal(bgr[..., 1],
|
|
241
|
-
... torch.where(torch.eq(ref_bgr_alpha[..., 3], 0), 0
|
|
241
|
+
... torch.where(torch.eq(ref_bgr_alpha[..., 3], 0.), 0., ref_bgr_alpha[..., 1]))
|
|
242
242
|
True
|
|
243
243
|
>>> torch.equal(bgr[..., 2],
|
|
244
|
-
... torch.where(torch.eq(ref_bgr_alpha[..., 3], 0), 0
|
|
244
|
+
... torch.where(torch.eq(ref_bgr_alpha[..., 3], 0.), 0., ref_bgr_alpha[..., 2]))
|
|
245
245
|
True
|
|
246
246
|
>>>
|
|
247
247
|
"""
|
|
@@ -284,41 +284,16 @@ class FrameVideo(Frame):
|
|
|
284
284
|
setattr(self, "context", time)
|
|
285
285
|
self.check_state() # convert time
|
|
286
286
|
|
|
287
|
-
def
|
|
288
|
-
"""Convert the frame into float32 in range [0, 1].
|
|
289
|
-
|
|
290
|
-
Returns
|
|
291
|
-
-------
|
|
292
|
-
frame : FrameVideo
|
|
293
|
-
A reference to self or a new casted frame.
|
|
294
|
-
|
|
295
|
-
Examples
|
|
296
|
-
--------
|
|
297
|
-
>>> import torch
|
|
298
|
-
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
299
|
-
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3, dtype=torch.uint8))
|
|
300
|
-
>>> frame.to_float32() # doctest: +ELLIPSIS
|
|
301
|
-
FrameVideo(0, [[[0., 0., 0.],
|
|
302
|
-
[0., 0., 0.],
|
|
303
|
-
[0., 0., 0.],
|
|
304
|
-
...,
|
|
305
|
-
[0., 0., 0.],
|
|
306
|
-
[0., 0., 0.],
|
|
307
|
-
[0., 0., 0.]]])
|
|
308
|
-
>>>
|
|
309
|
-
"""
|
|
310
|
-
if self.dtype == torch.float32:
|
|
311
|
-
return self
|
|
312
|
-
frame = self.to(torch.float32)
|
|
313
|
-
frame /= 255.0
|
|
314
|
-
return frame
|
|
315
|
-
|
|
316
|
-
def to_numpy_bgr(self, contiguous=False) -> np.ndarray[np.uint8]:
|
|
287
|
+
def to_numpy_rgb(self, contiguous=True) -> np.ndarray[np.uint8]:
|
|
317
288
|
"""Return the 3 channels uint8 numpy frame representation.
|
|
318
289
|
|
|
290
|
+
The colorspace is not changed, apply
|
|
291
|
+
``cutcutcodec.core.filter.video.colorspace.FilterVideoColorspace``
|
|
292
|
+
before if you want to control it.
|
|
293
|
+
|
|
319
294
|
Parameters
|
|
320
295
|
----------
|
|
321
|
-
contiguous : boolean, default=
|
|
296
|
+
contiguous : boolean, default=True
|
|
322
297
|
If True, guaranti that the returned numpy array is c-contiguous.
|
|
323
298
|
|
|
324
299
|
Examples
|
|
@@ -326,65 +301,27 @@ class FrameVideo(Frame):
|
|
|
326
301
|
>>> import torch
|
|
327
302
|
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
328
303
|
>>>
|
|
329
|
-
>>> #
|
|
330
|
-
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_bgr() # classical bgr
|
|
331
|
-
>>> type(frame), frame.shape, frame.dtype
|
|
332
|
-
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
333
|
-
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_bgr() # grayscale
|
|
334
|
-
>>> type(frame), frame.shape, frame.dtype
|
|
335
|
-
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
336
|
-
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_bgr() # alpha channel
|
|
337
|
-
>>> type(frame), frame.shape, frame.dtype
|
|
338
|
-
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
339
|
-
>>>
|
|
340
|
-
>>> # from uint8
|
|
341
|
-
>>> frame = FrameVideo(0, torch.empty(480, 720, 3, dtype=torch.uint8)).to_numpy_bgr()
|
|
304
|
+
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_rgb() # classical bgr
|
|
342
305
|
>>> type(frame), frame.shape, frame.dtype
|
|
343
306
|
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
344
|
-
>>> frame = FrameVideo(0, torch.
|
|
307
|
+
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_rgb() # grayscale
|
|
345
308
|
>>> type(frame), frame.shape, frame.dtype
|
|
346
309
|
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
347
|
-
>>> frame = FrameVideo(0, torch.
|
|
310
|
+
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_rgb() # alpha channel
|
|
348
311
|
>>> type(frame), frame.shape, frame.dtype
|
|
349
312
|
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
350
313
|
>>>
|
|
351
314
|
"""
|
|
352
315
|
assert isinstance(contiguous, bool), contiguous.__class__.__name__
|
|
353
|
-
|
|
316
|
+
frame = self.convert(3).flip(2) # to rgb
|
|
317
|
+
frame *= frame # inplace safe because flip make copy
|
|
318
|
+
frame += 0.5 # to transform floor in round for positive values
|
|
319
|
+
frame = frame.to(torch.uint8)
|
|
320
|
+
frame_np = frame.numpy(force=True)
|
|
354
321
|
if contiguous:
|
|
355
322
|
return np.ascontiguousarray(frame_np)
|
|
356
323
|
return frame_np
|
|
357
324
|
|
|
358
|
-
def to_uint8(self) -> typing.Self:
|
|
359
|
-
"""Convert the frame into uint8 in range [0, 255].
|
|
360
|
-
|
|
361
|
-
Returns
|
|
362
|
-
-------
|
|
363
|
-
frame : FrameVideo
|
|
364
|
-
A reference to self or a new casted frame.
|
|
365
|
-
|
|
366
|
-
Examples
|
|
367
|
-
--------
|
|
368
|
-
>>> import torch
|
|
369
|
-
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
370
|
-
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3, dtype=torch.float32))
|
|
371
|
-
>>> frame.to_uint8() # doctest: +ELLIPSIS
|
|
372
|
-
FrameVideo(0, [[[0, 0, 0],
|
|
373
|
-
[0, 0, 0],
|
|
374
|
-
[0, 0, 0],
|
|
375
|
-
...,
|
|
376
|
-
[0, 0, 0],
|
|
377
|
-
[0, 0, 0],
|
|
378
|
-
[0, 0, 0]]])
|
|
379
|
-
>>>
|
|
380
|
-
"""
|
|
381
|
-
if self.dtype == torch.uint8:
|
|
382
|
-
return self
|
|
383
|
-
frame = 255.0 * self
|
|
384
|
-
frame += 0.5 # to transform floor in round
|
|
385
|
-
frame = frame.to(torch.uint8)
|
|
386
|
-
return frame
|
|
387
|
-
|
|
388
325
|
@property
|
|
389
326
|
def width(self) -> int:
|
|
390
327
|
"""Return the dimension j (horizontal) of the image in pxl.
|
|
@@ -81,22 +81,6 @@ class Node(abc.ABC):
|
|
|
81
81
|
"""Try to avoid realocation as much as possible if False."""
|
|
82
82
|
return self._copy
|
|
83
83
|
|
|
84
|
-
@classmethod
|
|
85
|
-
@abc.abstractmethod
|
|
86
|
-
def default(cls):
|
|
87
|
-
"""Provide an example of an instance of this node.
|
|
88
|
-
|
|
89
|
-
Returns
|
|
90
|
-
-------
|
|
91
|
-
example : Node
|
|
92
|
-
An example of an instance of this class.
|
|
93
|
-
|
|
94
|
-
Notes
|
|
95
|
-
-----
|
|
96
|
-
It is a ``classmethod`` rather than a ``staticmethod`` in order to simplify inheritance.
|
|
97
|
-
"""
|
|
98
|
-
raise NotImplementedError
|
|
99
|
-
|
|
100
84
|
def getstate(self) -> dict:
|
|
101
85
|
"""Retrieve the internal state of the object.
|
|
102
86
|
|
|
@@ -28,31 +28,6 @@ class StreamVideo(Stream):
|
|
|
28
28
|
super().__init__(node)
|
|
29
29
|
self._mask = None # for cache speedup
|
|
30
30
|
|
|
31
|
-
@staticmethod
|
|
32
|
-
def _frame_to_float(frame: torch.Tensor) -> torch.Tensor:
|
|
33
|
-
"""Convert a video frame or a tensor into float32.
|
|
34
|
-
|
|
35
|
-
Warning, avoid copy as much as possible.
|
|
36
|
-
"""
|
|
37
|
-
if frame.dtype.is_floating_point:
|
|
38
|
-
return frame
|
|
39
|
-
frame = frame.to(torch.float32)
|
|
40
|
-
return torch.mul(frame, 1/255, out=frame)
|
|
41
|
-
|
|
42
|
-
@staticmethod
|
|
43
|
-
def _frame_to_uint8(frame: torch.Tensor) -> torch.Tensor:
|
|
44
|
-
"""Convert a video frame into an uint8 tensor.
|
|
45
|
-
|
|
46
|
-
Warning, avoid copy as much as possible.
|
|
47
|
-
"""
|
|
48
|
-
if frame.dtype == torch.uint8:
|
|
49
|
-
return frame
|
|
50
|
-
frame = torch.mul(frame, 255.0, out=frame)
|
|
51
|
-
frame = torch.clip(frame, 0.0, 255.0, out=frame)
|
|
52
|
-
frame = torch.round(frame, out=frame)
|
|
53
|
-
frame = frame.to(torch.uint8)
|
|
54
|
-
return frame
|
|
55
|
-
|
|
56
31
|
def _from_masked_items(self, flat_frame: torch.Tensor, mask: torch.Tensor) -> torch.Tensor:
|
|
57
32
|
"""Return a new frame with the initialised values at the position given by the mask.
|
|
58
33
|
|
|
@@ -79,7 +54,7 @@ class StreamVideo(Stream):
|
|
|
79
54
|
|
|
80
55
|
Returns
|
|
81
56
|
-------
|
|
82
|
-
torch.Tensor[
|
|
57
|
+
torch.Tensor[torch.float32]
|
|
83
58
|
A floting point matrix of pixel between 0 and 1.
|
|
84
59
|
"""
|
|
85
60
|
raise NotImplementedError
|
|
@@ -139,12 +114,11 @@ class StreamVideo(Stream):
|
|
|
139
114
|
assert all(isinstance(s, numbers.Integral) and s >= 1 for s in shape), shape
|
|
140
115
|
shape = (int(shape[0]), int(shape[1]))
|
|
141
116
|
if math.isnan(timestamp): # default transparent video frame
|
|
142
|
-
frame = FrameVideo(0, torch.zeros((*shape, 2)
|
|
117
|
+
frame = FrameVideo(0, torch.zeros((*shape, 2)))
|
|
143
118
|
else:
|
|
144
119
|
if self._mask is None or self._mask.shape != shape:
|
|
145
120
|
self._mask = torch.full(shape, True, dtype=bool)
|
|
146
121
|
frame = self._snapshot(Fraction(timestamp), self._mask)
|
|
147
|
-
frame = self._frame_to_uint8(frame)
|
|
148
122
|
frame = FrameVideo(timestamp, frame)
|
|
149
123
|
if channels is not None:
|
|
150
124
|
frame = frame.convert(channels)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
r"""Manage color spaces.
|
|
4
|
+
|
|
5
|
+
.. math::
|
|
6
|
+
|
|
7
|
+
\begin{pmatrix} y' \\ p_b \\ p_r \end{pmatrix}_{p,t}
|
|
8
|
+
\overset{T_1}\longleftrightarrow
|
|
9
|
+
\begin{pmatrix} r' \\ g' \\ b' \end{pmatrix}_{p,t}
|
|
10
|
+
\overset{T_2}\longleftrightarrow
|
|
11
|
+
\begin{pmatrix} r \\ g \\ b \end{pmatrix}_{p}
|
|
12
|
+
\overset{T_3}\longleftrightarrow
|
|
13
|
+
\begin{pmatrix} x \\ y \\ z \end{pmatrix}
|
|
14
|
+
|
|
15
|
+
With:
|
|
16
|
+
* :math:`p` is the color primaries (gamut), tristimulus values defined in the cst module
|
|
17
|
+
:py:mod:`cutcutcodec.core.colorspace.cst` as the `PRIMARIES` constant.
|
|
18
|
+
* :math:`t` is the transfere function (gamma), defined in the cst module
|
|
19
|
+
:py:mod:`cutcutcodec.core.colorspace.cst` as the `TRC` constant.
|
|
20
|
+
* :math:`\begin{pmatrix} y' \\ p_b \\ p_r \end{pmatrix}_{p,t}`
|
|
21
|
+
is the color space in which video is encoded in `yuv` pixel format.
|
|
22
|
+
:math:`y' \in [0, 1]` is the luma,
|
|
23
|
+
:math:`p_b \in \left[-\frac{1}{2}, \frac{1}{2}\right]` the blue difference and
|
|
24
|
+
:math:`p_r \in \left[-\frac{1}{2}, \frac{1}{2}\right]` the red difference.
|
|
25
|
+
As the human eye perceives differences in luminosity
|
|
26
|
+
better in dark values than in bright ones,
|
|
27
|
+
:math:`y'` stretches low values in order to encode dark pixels more accurately
|
|
28
|
+
The :math:`u` and :math:`v` values encode chrominance,
|
|
29
|
+
which is less important than luminance for the human eye.
|
|
30
|
+
So they are encoded with fewer bits than :math:`y'`
|
|
31
|
+
* :math:`\begin{pmatrix} r' \\ g' \\ b' \end{pmatrix}_{p,t}`
|
|
32
|
+
is the gamma corrected color space expected by terminals (screen, TV, printer, etc...).
|
|
33
|
+
For example, this is the space expected by matplotlib's imshow function.
|
|
34
|
+
:math:`r' \in [0, 1]` is the non-linear red,
|
|
35
|
+
:math:`g' \in [0, 1]` the non-linear green and
|
|
36
|
+
:math:`b' \in [0, 1]` the non-linear blue.
|
|
37
|
+
As this space depends on a primaries :math:`p` and a transfer function :math:`t`,
|
|
38
|
+
we have to choose the one expected by the terminal to obtain a faithful color representation.
|
|
39
|
+
* :math:`\begin{pmatrix} r \\ g \\ b \end{pmatrix}_{p}`
|
|
40
|
+
is the linear workspace in which all cutcutcodec operations are performed.
|
|
41
|
+
:math:`r \in [0, 1]` is the linear red,
|
|
42
|
+
:math:`g \in [0, 1]` the linear green and
|
|
43
|
+
:math:`b \in [0, 1]` the linear blue.
|
|
44
|
+
Unlike the non-linear rgb space, color mixing (and many other physics laws)
|
|
45
|
+
are correct in this space only.
|
|
46
|
+
* :math:`\begin{pmatrix} x \\ y \\ z \end{pmatrix}_{p}`
|
|
47
|
+
is the absolute CIE 1931 reference space, independent of
|
|
48
|
+
any transfer function :math:`t` and any primaries :math:`p`.
|
|
49
|
+
As soon as you change your transfer function or color primaries, you pass through this space.
|
|
50
|
+
:math:`(x, y, z) \in \mathbb{R}^3`
|
|
51
|
+
* :math:`T_1` is a linear transformation that depends on the primaries :math:`p`,
|
|
52
|
+
implemented in :py:func:`cutcutcodec.core.colorspace.func.rgb2yuv_matrix_from_kr_kb`.
|
|
53
|
+
* :math:`T_2` is the transformation that applies the non-linear
|
|
54
|
+
transfer function :math:`t` to each red, green and blue component.
|
|
55
|
+
* :math:`T_3` is a linear transformation that depends on the primaries :math:`p`,
|
|
56
|
+
implemented in :py:func:`cutcutcodec.core.colorspace.func.rgb2xyz_matrix_from_chroma`.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
from .func import convert
|
|
60
|
+
|
|
61
|
+
__all__ = ["convert"]
|