Skip to main content

Dependency for recognizing and executing Image Super-Resolution PyTorch architectures

Project description

nusselt

Usage

from nusselt import ModelLoader, ImageTransformer
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = ModelLoader(device).load_from_file("4x_sr_model.pth")
model.eval()

image = ImageTransformer.read_image("input.png", "grayscale" if model.input_channels == 1 else "color")
output = ImageTransformer.img2tensor(image).to(device)

with torch.no_grad():
    output = model(output)

output_image = ImageTransformer.tensor2img(output)
ImageTransformer.write_image(output_image, "output.png")

Architectures

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nusselt-0.1.1-py3-none-any.whl (37.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page