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
- Based on chaiNNer-org/spandrel
Project details
Release history Release notifications | RSS feed
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)