soifunc 0.11.3__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/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
|
|
15
|
-
from vstools import check_variable_format,
|
|
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
|
-
|
|
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
|
-
|
|
106
|
-
scaler_cls = Scaler.from_param(scaler, _get_scaler)
|
|
60
|
+
luma = luma_scaler.scale(clip, width, height, shift)
|
|
107
61
|
|
|
108
|
-
|
|
62
|
+
if clip.format.num_planes == 1:
|
|
63
|
+
return luma
|
|
109
64
|
|
|
110
|
-
|
|
65
|
+
chroma = chroma_scaler.scale(clip, width, height, shift)
|
|
111
66
|
|
|
112
|
-
return
|
|
67
|
+
return join(luma, chroma)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: soifunc
|
|
3
|
-
Version: 0.
|
|
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.
|
|
14
|
+
Requires-Dist: vsjetpack (>=0.7.1,<0.8.0)
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
|
|
17
17
|
## soifunc
|
|
@@ -3,8 +3,8 @@ soifunc/deband.py,sha256=MbI5OOG8JpWqM5B5ux6OU784-39PtCMQWrh9mk4k2xY,1273
|
|
|
3
3
|
soifunc/denoise.py,sha256=ALTftqL9Q1cPLKtAU60mT3-RUkVHXBqgg2Pa9GwjGIY,6982
|
|
4
4
|
soifunc/interpolate.py,sha256=dgYczCdn716afJ3sZgQgcF6KfAkaU2J_obJD-Kp7wP4,4091
|
|
5
5
|
soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
soifunc/resize.py,sha256=
|
|
7
|
-
soifunc-0.
|
|
8
|
-
soifunc-0.
|
|
9
|
-
soifunc-0.
|
|
10
|
-
soifunc-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,,
|
|
File without changes
|
|
File without changes
|