How to use the getnative.utils.get_source_filter 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 _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])
    elif args.mode == "all":
        mode = [s for scaler in common_scaler.values() for s in scaler]

    for i, scaler in enumerate(mode):
        if scaler is not None and scaler.plugin is None:

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