Instructions to use MahoCommerce/Real_HAT_GAN_sharper-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use MahoCommerce/Real_HAT_GAN_sharper-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-to-image', 'MahoCommerce/Real_HAT_GAN_sharper-ONNX');
Real_HAT_GAN_sharper (ONNX)
An ONNX export of Real_HAT_GAN_SRx4_sharper.pth from XPixelGroup/HAT, for the image editor of Maho.
HAT is by Xiangyu Chen, Xintao Wang, Jiantao Zhou, Yu Qiao and Chao Dong, under the Apache-2.0 license.
- Scale: 4ร. Input
pixel_values, a float32 tensor of shape[1, 3, 192, 192]with values from 0 to 1. Outputreconstruction, shape[1, 3, 768, 768]. - The input shape is fixed. Cut a larger image into tiles of 192 ร 192 pixels.
- fp32 only. The model gives NaN values in fp16.
config.jsonsetsmodel_typetoswin2sr, so that transformers.js loads the file withAutoModelForImageToImage. The model is HAT, not Swin2SR.
Exported with spandrel 0.4.2 and torch.onnx.export (opset 17).
@InProceedings{chen2023activating,
author = {Chen, Xiangyu and Wang, Xintao and Zhou, Jiantao and Qiao, Yu and Dong, Chao},
title = {Activating More Pixels in Image Super-Resolution Transformer},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2023},
}
- Downloads last month
- 45