Push model using huggingface_hub.
Browse files- README.md +6 -74
- config.json +1 -1
- model.safetensors +2 -2
README.md
CHANGED
|
@@ -1,78 +1,10 @@
|
|
| 1 |
---
|
| 2 |
tags:
|
| 3 |
-
-
|
| 4 |
-
|
| 5 |
-
license: apache-2.0
|
| 6 |
---
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
## Key Features
|
| 13 |
-
|
| 14 |
-
- **Fast and scalable**: Instead of predicting the individual pixels of the upscaled image, Ultra Zoom uses a unique "zoom in and enhance" approach that combines the speed of deterministic bicubic interpolation with the power of a deep neural network.
|
| 15 |
-
|
| 16 |
-
- **Full RGB**: Unlike many efficient SR models that only operate in the luminance domain, Ultra Zoom operates within the full RGB color domain enhancing both luminance and chrominance for the best possible quality.
|
| 17 |
-
|
| 18 |
-
- **Denoising and Deblurring**: During the enhancement stage, the model removes multiple types of noise and blur making images look crisp and clean.
|
| 19 |
-
|
| 20 |
-
## Pretrained Models
|
| 21 |
-
|
| 22 |
-
The following pretrained models are available on HuggingFace Hub.
|
| 23 |
-
|
| 24 |
-
| Name | Zoom | Num Channels | Hidden Ratio | Encoder Layers | Total Parameters |
|
| 25 |
-
|---|---|---|---|---|---|
|
| 26 |
-
| [andrewdalpino/UltraZoom-2X](https://huggingface.co/andrewdalpino/UltraZoom-2X) | 2X | 48 | 2X | 20 | 1.8M |
|
| 27 |
-
| [andrewdalpino/UltraZoom-3X](https://huggingface.co/andrewdalpino/UltraZoom-3X) | 3X | 54 | 2X | 30 | 3.5M |
|
| 28 |
-
| [andrewdalpino/UltraZoom-4X](https://huggingface.co/andrewdalpino/UltraZoom-4X) | 4X | 96 | 2X | 40 | 14M |
|
| 29 |
-
|
| 30 |
-
## Pretrained Example
|
| 31 |
-
|
| 32 |
-
If you'd just like to load the pretrained weights and do inference, getting started is as simple as in the example below. First, you'll need the `ultrazoom` and `torchvision` Python packages installed into your project.
|
| 33 |
-
|
| 34 |
-
```sh
|
| 35 |
-
pip install ultrazoom torchvision
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
Next, load the model weights from HuggingFace Hub and feed the network some images.
|
| 39 |
-
|
| 40 |
-
```python
|
| 41 |
-
import torch
|
| 42 |
-
|
| 43 |
-
from torchvision.io import decode_image
|
| 44 |
-
from torchvision.transforms.v2 import ToDtype, ToPILImage
|
| 45 |
-
|
| 46 |
-
from ultrazoom.model import UltraZoom
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
model_name = "andrewdalpino/UltraZoom-4X"
|
| 50 |
-
image_path = "./dataset/bird.png"
|
| 51 |
-
|
| 52 |
-
model = UltraZoom.from_pretrained(model_name)
|
| 53 |
-
|
| 54 |
-
image_to_tensor = ToDtype(torch.float32, scale=True)
|
| 55 |
-
tensor_to_pil = ToPILImage()
|
| 56 |
-
|
| 57 |
-
image = decode_image(image_path, mode="RGB")
|
| 58 |
-
|
| 59 |
-
x = image_to_tensor(image).unsqueeze(0)
|
| 60 |
-
|
| 61 |
-
y_pred = model.upscale(x)
|
| 62 |
-
|
| 63 |
-
pil_image = tensor_to_pil(y_pred.squeeze(0))
|
| 64 |
-
|
| 65 |
-
pil_image.show()
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
## Code Repository
|
| 69 |
-
|
| 70 |
-
The code repository can be found at [https://github.com/andrewdalpino/UltraZoom](https://github.com/andrewdalpino/UltraZoom).
|
| 71 |
-
|
| 72 |
-
## References
|
| 73 |
-
|
| 74 |
-
>- Z. Liu, et al. A ConvNet for the 2020s, 2022.
|
| 75 |
-
>- J. Yu, et al. Wide Activation for Efficient and Accurate Image Super-Resolution, 2018.
|
| 76 |
-
>- J. Johnson, et al. Perceptual Losses for Real_time Style Transfer and Super-Resolution, 2016.
|
| 77 |
-
>- W. Shi, et al. Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network, 2016.
|
| 78 |
-
>- T. Salimans, et al. Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks, OpenAI, 2016.
|
|
|
|
| 1 |
---
|
| 2 |
tags:
|
| 3 |
+
- model_hub_mixin
|
| 4 |
+
- pytorch_model_hub_mixin
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
+
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 8 |
+
- Code: [More Information Needed]
|
| 9 |
+
- Paper: [More Information Needed]
|
| 10 |
+
- Docs: [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"hidden_ratio": 2,
|
| 3 |
"num_channels": 96,
|
| 4 |
-
"num_encoder_layers":
|
| 5 |
"upscale_ratio": 4
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"hidden_ratio": 2,
|
| 3 |
"num_channels": 96,
|
| 4 |
+
"num_encoder_layers": 40,
|
| 5 |
"upscale_ratio": 4
|
| 6 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c8e2939a879acddee3cc0d26c327452f06da4b18fa57147cd9ac6dbbc47f790
|
| 3 |
+
size 56685800
|