Update README.md
Browse files
README.md
CHANGED
@@ -14,7 +14,7 @@ license: mit
|
|
14 |
|
15 |
## Model description
|
16 |
|
17 |
-
This model is a [Pix2Pix]() model trained on the [huggan/maps]() dataset. The goal for the model is to turn a satellite map into a geographic map à la Google Maps, and the other way around.
|
18 |
|
19 |
The model was trained using the [example script](https://github.com/huggingface/community-events/tree/main/huggan/pytorch/pix2pix) provided by HuggingFace as part of the [HugGAN sprint](https://github.com/huggingface/community-events/tree/main/huggan).
|
20 |
|
@@ -23,9 +23,18 @@ The model was trained using the [example script](https://github.com/huggingface/
|
|
23 |
#### How to use
|
24 |
|
25 |
```python
|
26 |
-
from huggan.pytorch.pix2pix import GeneratorUNet
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
generator = GeneratorUNet.from_pretrained("huggan/pix2pix-maps")
|
|
|
|
|
|
|
|
|
29 |
```
|
30 |
|
31 |
#### Limitations and bias
|
|
|
14 |
|
15 |
## Model description
|
16 |
|
17 |
+
This model is a [Pix2Pix](https://arxiv.org/abs/1611.07004) model trained on the [huggan/maps](https://huggingface.co/datasets/huggan/maps) dataset. The goal for the model is to turn a satellite map into a geographic map à la Google Maps, and the other way around.
|
18 |
|
19 |
The model was trained using the [example script](https://github.com/huggingface/community-events/tree/main/huggan/pytorch/pix2pix) provided by HuggingFace as part of the [HugGAN sprint](https://github.com/huggingface/community-events/tree/main/huggan).
|
20 |
|
|
|
23 |
#### How to use
|
24 |
|
25 |
```python
|
26 |
+
from huggan.pytorch.pix2pix.modeling_pix2pix import GeneratorUNet
|
27 |
+
import requests
|
28 |
+
from PIL import Image
|
29 |
+
from torchvision.utils import save_image
|
30 |
+
|
31 |
+
image = Image.open("...")
|
32 |
|
33 |
generator = GeneratorUNet.from_pretrained("huggan/pix2pix-maps")
|
34 |
+
|
35 |
+
pixel_values = transform(image).unsqueeze(0)
|
36 |
+
output = generator(pixel_values)
|
37 |
+
save_image(output, 'output.png', normalize=True)
|
38 |
```
|
39 |
|
40 |
#### Limitations and bias
|