funcs ¶
ClampScaler dataclass
¶
ClampScaler(
ref_scaler: ScalerT,
strength: int = 80,
overshoot: float | None = None,
undershoot: float | None = None,
limit: RepairMode | bool = True,
operator: Literal[MAX, MIN] | None = MIN,
masked: bool = True,
reference: ScalerT | VideoNode = Nnedi3,
*,
kernel: KernelT | None = None,
scaler: ScalerT | None = None,
shifter: KernelT | None = None
)
Bases: GenericScaler
Clamp a reference Scaler.
kernel class-attribute
instance-attribute
¶
Base kernel to be used for certain scaling/shifting/resampling operations. Must be specified and defaults to catrom
limit class-attribute
instance-attribute
¶
limit: RepairMode | bool = True
Whether to use under/overshoot limit (True) or a reference repaired clip for limiting.
masked class-attribute
instance-attribute
¶
masked: bool = True
Whether to mask with a ringing mask or not.
operator class-attribute
instance-attribute
¶
Whether to take the brightest or darkest pixels in the merge.
reference class-attribute
instance-attribute
¶
Reference Scaler used to clamp ref_scaler
scale_function instance-attribute
¶
scale_function: GenericVSFunction
Scale function called internally when scaling
scaler class-attribute
instance-attribute
¶
Scaler used for scaling operations. Defaults to kernel.
shifter class-attribute
instance-attribute
¶
Kernel used for shifting operations. Defaults to kernel.
undershoot class-attribute
instance-attribute
¶
undershoot: float | None = None
Undershoot threshold.
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> BaseScalerT
Source code
186 187 188 189 190 191 192 193 |
|
ensure_scaler ¶
Source code
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
from_param classmethod
¶
from_param(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[BaseScalerT]
Source code
177 178 179 180 181 182 183 184 |
|
get_clean_kwargs ¶
Source code
199 200 |
|
get_implemented_funcs ¶
Source code
270 271 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
*funcs: Callable[..., Any],
**kwargs: Any
) -> KwargsT
Source code
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
multi ¶
multi(
clip: VideoNode,
multi: float = 2,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNode
Source code
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
pretty_string ¶
pretty_string() -> str
Source code
202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[float, float] = (0, 0),
*,
smooth: VideoNode | None = None,
**kwargs: Any
) -> VideoNode
Source code
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
MergeScalers ¶
Bases: GenericScaler
Create a unified Scaler from multiple Scalers with optional weights.
Source code
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
kernel class-attribute
instance-attribute
¶
Base kernel to be used for certain scaling/shifting/resampling operations. Must be specified and defaults to catrom
scale_function instance-attribute
¶
scale_function: GenericVSFunction
Scale function called internally when scaling
scaler class-attribute
instance-attribute
¶
Scaler used for scaling operations. Defaults to kernel.
scalers instance-attribute
¶
scalers = [
(ensure_scaler(scaler), float(weight if weight else 0))
for (scaler, weight) in norm_scalers
]
shifter class-attribute
instance-attribute
¶
Kernel used for shifting operations. Defaults to kernel.
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> BaseScalerT
Source code
186 187 188 189 190 191 192 193 |
|
ensure_scaler ¶
Source code
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
from_param classmethod
¶
from_param(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[BaseScalerT]
Source code
177 178 179 180 181 182 183 184 |
|
get_clean_kwargs ¶
Source code
199 200 |
|
get_implemented_funcs ¶
Source code
270 271 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
*funcs: Callable[..., Any],
**kwargs: Any
) -> KwargsT
Source code
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
multi ¶
multi(
clip: VideoNode,
multi: float = 2,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNode
Source code
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
pretty_string ¶
pretty_string() -> str
Source code
202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[float, float] = (0, 0),
**kwargs: Any
) -> VideoNode
Source code
79 80 81 82 83 84 85 86 87 88 89 90 |
|
MergedFSRCNNX dataclass
¶
MergedFSRCNNX(
strength: int = 80,
overshoot: float | None = None,
undershoot: float | None = None,
limit: RepairMode | bool = True,
operator: Literal[MAX, MIN] | None = MIN,
masked: bool = True,
reference: ScalerT | VideoNode = Nnedi3,
*,
kernel: KernelT | None = None,
scaler: ScalerT | None = None,
shifter: KernelT | None = None,
ref_scaler: FSRCNNXShaderT = lambda: x56()
)
Bases: ClampScaler
Clamped FSRCNNX Scaler.
kernel class-attribute
instance-attribute
¶
Base kernel to be used for certain scaling/shifting/resampling operations. Must be specified and defaults to catrom
limit class-attribute
instance-attribute
¶
limit: RepairMode | bool = True
Whether to use under/overshoot limit (True) or a reference repaired clip for limiting.
masked class-attribute
instance-attribute
¶
masked: bool = True
Whether to mask with a ringing mask or not.
operator class-attribute
instance-attribute
¶
Whether to take the brightest or darkest pixels in the merge.
ref_scaler class-attribute
instance-attribute
¶
ref_scaler: FSRCNNXShaderT = field(default_factory=lambda: x56, kw_only=True)
reference class-attribute
instance-attribute
¶
Reference Scaler used to clamp ref_scaler
scale_function instance-attribute
¶
scale_function: GenericVSFunction
Scale function called internally when scaling
scaler class-attribute
instance-attribute
¶
Scaler used for scaling operations. Defaults to kernel.
shifter class-attribute
instance-attribute
¶
Kernel used for shifting operations. Defaults to kernel.
undershoot class-attribute
instance-attribute
¶
undershoot: float | None = None
Undershoot threshold.
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> BaseScalerT
Source code
186 187 188 189 190 191 192 193 |
|
ensure_scaler ¶
Source code
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
from_param classmethod
¶
from_param(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[BaseScalerT]
Source code
177 178 179 180 181 182 183 184 |
|
get_clean_kwargs ¶
Source code
199 200 |
|
get_implemented_funcs ¶
Source code
270 271 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
*funcs: Callable[..., Any],
**kwargs: Any
) -> KwargsT
Source code
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
multi ¶
multi(
clip: VideoNode,
multi: float = 2,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNode
Source code
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
pretty_string ¶
pretty_string() -> str
Source code
202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[float, float] = (0, 0),
*,
smooth: VideoNode | None = None,
**kwargs: Any
) -> VideoNode
Source code
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
UnsharpLimitScaler ¶
UnsharpLimitScaler(
ref_scaler: ScalerT,
unsharp_func: Callable[Concatenate[VideoNode, P], VideoNode] = partial(
unsharp_masked, radius=2, strength=65
),
merge_mode: LimitFilterMode | bool = True,
reference: ScalerT | VideoNode = Nnedi3(0, opencl=None),
*args: args,
**kwargs: kwargs
)
Bases: GenericScaler
Limit a scaler with a masked unsharping.
Parameters:
-
ref_scaler
¶ScalerT
) –Scaler of which to limit haloing.
-
unsharp_func
¶Callable[Concatenate[VideoNode, P], VideoNode]
, default:partial(unsharp_masked, radius=2, strength=65)
) –Unsharpening function used as reference for limiting.
-
merge_mode
¶LimitFilterMode | bool
, default:True
) –Whether to limit with LimitFilterMode, use a median filter (True) or just take the darkest pixels (False).
-
reference
¶ScalerT | VideoNode
, default:Nnedi3(0, opencl=None)
) –Reference scaler used to fill in the haloed parts.
Source code
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
kernel class-attribute
instance-attribute
¶
Base kernel to be used for certain scaling/shifting/resampling operations. Must be specified and defaults to catrom
scale_function instance-attribute
¶
scale_function: GenericVSFunction
Scale function called internally when scaling
scaler class-attribute
instance-attribute
¶
Scaler used for scaling operations. Defaults to kernel.
shifter class-attribute
instance-attribute
¶
Kernel used for shifting operations. Defaults to kernel.
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> BaseScalerT
Source code
186 187 188 189 190 191 192 193 |
|
ensure_scaler ¶
Source code
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
from_param classmethod
¶
from_param(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[BaseScalerT]
Source code
177 178 179 180 181 182 183 184 |
|
get_clean_kwargs ¶
Source code
199 200 |
|
get_implemented_funcs ¶
Source code
270 271 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
*funcs: Callable[..., Any],
**kwargs: Any
) -> KwargsT
Source code
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
multi ¶
multi(
clip: VideoNode,
multi: float = 2,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNode
Source code
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
pretty_string ¶
pretty_string() -> str
Source code
202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[float, float] = (0, 0),
*,
smooth: VideoNode | None = None,
**kwargs: Any
) -> VideoNode
Source code
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
UnsharpedFSRCNNX ¶
UnsharpedFSRCNNX(
unsharp_func: Callable[Concatenate[VideoNode, P], VideoNode] = partial(
unsharp_masked, radius=2, strength=65
),
merge_mode: LimitFilterMode | bool = True,
reference: ScalerT | VideoNode = Nnedi3(0, opencl=None),
ref_scaler: ScalerT = x56,
*args: args,
**kwargs: kwargs
)
Bases: UnsharpLimitScaler
Clamped FSRCNNX Scaler with an unsharp mask.
Source code
280 281 282 283 284 285 286 287 288 289 290 |
|
kernel class-attribute
instance-attribute
¶
Base kernel to be used for certain scaling/shifting/resampling operations. Must be specified and defaults to catrom
scale_function instance-attribute
¶
scale_function: GenericVSFunction
Scale function called internally when scaling
scaler class-attribute
instance-attribute
¶
Scaler used for scaling operations. Defaults to kernel.
shifter class-attribute
instance-attribute
¶
Kernel used for shifting operations. Defaults to kernel.
ensure_obj classmethod
¶
ensure_obj(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> BaseScalerT
Source code
186 187 188 189 190 191 192 193 |
|
ensure_scaler ¶
Source code
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
from_param classmethod
¶
from_param(
scaler: str | type[BaseScalerT] | BaseScalerT | None = None,
/,
func_except: FuncExceptT | None = None,
) -> type[BaseScalerT]
Source code
177 178 179 180 181 182 183 184 |
|
get_clean_kwargs ¶
Source code
199 200 |
|
get_implemented_funcs ¶
Source code
270 271 |
|
get_scale_args ¶
get_scale_args(
clip: VideoNode,
shift: tuple[TopShift, LeftShift] = (0, 0),
width: int | None = None,
height: int | None = None,
*funcs: Callable[..., Any],
**kwargs: Any
) -> KwargsT
Source code
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
multi ¶
multi(
clip: VideoNode,
multi: float = 2,
shift: tuple[TopShift, LeftShift] = (0, 0),
**kwargs: Any
) -> VideoNode
Source code
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
pretty_string ¶
pretty_string() -> str
Source code
202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
scale ¶
scale(
clip: VideoNode,
width: int | None = None,
height: int | None = None,
shift: tuple[float, float] = (0, 0),
*,
smooth: VideoNode | None = None,
**kwargs: Any
) -> VideoNode
Source code
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|