How to use the getnative.utils.get_attr function in getnative

To help you get started, we’ve selected a few getnative examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Infiziert90 / getnative / getnative / app.py View on Github external
def __init__(self, kernel: str, b: Union[float, int] = 0, c: Union[float, int] = 0, taps: int = 0):
        """
        Get a scaler for getnative from descale

        :param kernel: kernel for descale
        :param b: b value for kernel "bicubic" (default 0)
        :param c: c value for kernel "bicubic" (default 0)
        :param taps: taps value for kernel "lanczos" (default 0)
        """

        self.kernel = kernel
        self.b = b
        self.c = c
        self.taps = taps
        _d = plugin_from_identifier(core, "tegaf.asi.xe")
        self.plugin = _d if _d is not None else get_attr(core, 'descale', None)
        if self.plugin is None:
            return

        self.descaler = getattr(self.plugin, f'De{self.kernel}', None)
        self.upscaler = getattr(core.resize, self.kernel.title())

        self.check_input()
        self.check_for_extra_paras()
github Infiziert90 / getnative / getnative / app.py View on Github external
def _getnative():
    args = parser.parse_args()

    if args.use:
        source_filter = get_attr(core, args.use)
        if not source_filter:
            raise GetnativeException(f"{args.use} is not available.")
        print(f"Using {args.use} as source filter")
    else:
        source_filter = get_source_filter(core, imwri, args)

    src = source_filter(args.input_file)

    mode = [None]  # default
    if args.mode == "bilinear":
        mode = [common_scaler["bilinear"][0]]
    elif args.mode == "bicubic":
        mode = [scaler for scaler in common_scaler["bicubic"]]
    elif args.mode == "bl-bc":
        mode = [scaler for scaler in common_scaler["bicubic"]]
        mode.append(common_scaler["bilinear"][0])

getnative

Find the native resolution(s) of upscaled material (mostly anime)

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages