soifunc 0.11.2__py3-none-any.whl → 0.12.0__py3-none-any.whl

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.
soifunc/interpolate.py CHANGED
@@ -4,6 +4,7 @@ import platform
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  import vstools
7
+ from vsscale import autoselect_backend
7
8
  from vstools import vs
8
9
 
9
10
  if TYPE_CHECKING:
@@ -40,15 +41,7 @@ def rate_doubler(
40
41
  model=vsmlrt.RIFEModel.v4_25_heavy,
41
42
  # Why these defaults? Because running ML stuff on AMD on Windows sucks hard.
42
43
  # Trial and error led me to finally find that ORT_DML works.
43
- backend=(
44
- backend
45
- if backend
46
- else (
47
- vsmlrt.Backend.ORT_DML()
48
- if platform.system() == "Windows"
49
- else vsmlrt.Backend.TRT()
50
- )
51
- ),
44
+ backend=(backend if backend else autoselect_backend()),
52
45
  )
53
46
  # TODO: Handle other chroma samplings
54
47
  clip = clip.resize.Bicubic(
@@ -98,15 +91,7 @@ def decimation_fixer(
98
91
  doubled = vsmlrt.RIFE(
99
92
  clip,
100
93
  model=vsmlrt.RIFEModel.v4_25_heavy,
101
- backend=(
102
- backend
103
- if backend
104
- else (
105
- vsmlrt.Backend.ORT_DML()
106
- if platform.system() == "Windows"
107
- else vsmlrt.Backend.TRT()
108
- )
109
- ),
94
+ backend=(backend if backend else autoselect_backend()),
110
95
  )
111
96
 
112
97
  out_clip = None
soifunc/resize.py CHANGED
@@ -1,22 +1,15 @@
1
1
  from __future__ import annotations
2
2
 
3
- from dataclasses import dataclass
4
- from inspect import getfullargspec
5
- from typing import Any
6
-
7
3
  from vsaa.deinterlacers import NNEDI3
8
4
  from vskernels import (
9
5
  Hermite,
10
- Scaler,
11
- ScalerLike,
12
6
  Spline36,
13
7
  )
14
- from vsscale import ArtCNN, GenericScaler
15
- from vstools import check_variable_format, inject_self, is_gpu_available, join, vs
8
+ from vsscale import ArtCNN
9
+ from vstools import check_variable_format, is_gpu_available, join, vs
16
10
 
17
11
  __all__ = [
18
12
  "good_resize",
19
- "HybridScaler",
20
13
  ]
21
14
 
22
15
 
@@ -62,51 +55,13 @@ def good_resize(
62
55
  else:
63
56
  luma_scaler = Hermite(sigmoid=True)
64
57
 
65
- return HybridScaler(luma_scaler, chroma_scaler).scale(
66
- clip, width, height, shift=shift
67
- )
68
-
69
-
70
- @dataclass
71
- class HybridScaler(GenericScaler):
72
- luma_scaler: ScalerLike
73
- chroma_scaler: ScalerLike
74
-
75
- def __post_init__(self) -> None:
76
- super().__post_init__()
77
-
78
- self._luma = Scaler.ensure_obj(self.luma_scaler)
79
- self._chroma = Scaler.ensure_obj(self.chroma_scaler)
80
-
81
- @Scaler.cached_property
82
- def kernel_radius(self) -> int:
83
- return self._luma.kernel_radius
84
-
85
- def scale( # type:ignore
86
- self,
87
- clip: vs.VideoNode,
88
- width: int,
89
- height: int,
90
- shift: tuple[float, float] = (0, 0),
91
- **kwargs: Any,
92
- ) -> vs.VideoNode:
93
- assert check_variable_format(clip, self.__class__)
94
-
95
- luma = self._luma.scale(clip, width, height, shift, **kwargs)
96
-
97
- if clip.format.num_planes == 1:
98
- return luma
99
-
100
- chroma = self._chroma.scale(clip, width, height, shift, **kwargs)
101
-
102
- return join(luma, chroma)
103
-
58
+ assert check_variable_format(clip, "good_resize")
104
59
 
105
- def _get_scaler(scaler: ScalerLike, **kwargs: Any) -> Scaler:
106
- scaler_cls = Scaler.from_param(scaler, _get_scaler)
60
+ luma = luma_scaler.scale(clip, width, height, shift)
107
61
 
108
- args = getfullargspec(scaler_cls).args
62
+ if clip.format.num_planes == 1:
63
+ return luma
109
64
 
110
- clean_kwargs = {key: value for key, value in kwargs.items() if key in args}
65
+ chroma = chroma_scaler.scale(clip, width, height, shift)
111
66
 
112
- return scaler_cls(**clean_kwargs)
67
+ return join(luma, chroma)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: soifunc
3
- Version: 0.11.2
3
+ Version: 0.12.0
4
4
  Summary: Soichiro's VapourSynth Functions Collection
5
5
  License: MIT
6
6
  Author: Josh Holmer
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
13
  Requires-Dist: vapoursynth (>=68)
14
- Requires-Dist: vsjetpack (>=0.5.1,<0.6.0)
14
+ Requires-Dist: vsjetpack (>=0.7.1,<0.8.0)
15
15
  Description-Content-Type: text/markdown
16
16
 
17
17
  ## soifunc
@@ -0,0 +1,10 @@
1
+ soifunc/__init__.py,sha256=H6BWoCLRW2ZD47wQtL72SIZvTpD6REH7cUqIYWvCn0k,174
2
+ soifunc/deband.py,sha256=MbI5OOG8JpWqM5B5ux6OU784-39PtCMQWrh9mk4k2xY,1273
3
+ soifunc/denoise.py,sha256=ALTftqL9Q1cPLKtAU60mT3-RUkVHXBqgg2Pa9GwjGIY,6982
4
+ soifunc/interpolate.py,sha256=dgYczCdn716afJ3sZgQgcF6KfAkaU2J_obJD-Kp7wP4,4091
5
+ soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ soifunc/resize.py,sha256=pSoQtrsxfWr44Wg4M9GRyMJnOsgnjsWEr6ZyoJW7Qkk,1781
7
+ soifunc-0.12.0.dist-info/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
8
+ soifunc-0.12.0.dist-info/METADATA,sha256=cIZ9ZFeGwNCWcyiyKTStP51OvnaG7pLWRX3fTcv0vzo,1214
9
+ soifunc-0.12.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
+ soifunc-0.12.0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- soifunc/__init__.py,sha256=H6BWoCLRW2ZD47wQtL72SIZvTpD6REH7cUqIYWvCn0k,174
2
- soifunc/deband.py,sha256=MbI5OOG8JpWqM5B5ux6OU784-39PtCMQWrh9mk4k2xY,1273
3
- soifunc/denoise.py,sha256=ALTftqL9Q1cPLKtAU60mT3-RUkVHXBqgg2Pa9GwjGIY,6982
4
- soifunc/interpolate.py,sha256=MNpYyO037H00vqA5d-WijeBd475oMssEvFLGXgeXPxw,4400
5
- soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- soifunc/resize.py,sha256=jr1kLU8IrXcLphjkhcXhls1HjhIKiryD8n6Kvwe1DU4,2988
7
- soifunc-0.11.2.dist-info/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
8
- soifunc-0.11.2.dist-info/METADATA,sha256=1u10t9uHSCroEByTObR45ceT88YjOqtW28dHejnV1e0,1214
9
- soifunc-0.11.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
- soifunc-0.11.2.dist-info/RECORD,,