Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,8 +18,16 @@ import pickle
|
|
| 18 |
from PIL import Image
|
| 19 |
import tqdm
|
| 20 |
import shutil
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
model_path = 'files/iam_model.pth'
|
| 22 |
|
|
|
|
| 23 |
batch_size = 1
|
| 24 |
print ('(1) Loading model...')
|
| 25 |
model = TRGAN(batch_size = batch_size)
|
|
@@ -75,6 +83,7 @@ iface = gr.Interface(
|
|
| 75 |
outputs=[#gr.Markdown("## Output"),
|
| 76 |
gr.Image(type="pil", label="Style Image"),
|
| 77 |
gr.Image(type="pil", label="Generated Image")],
|
|
|
|
| 78 |
thumbnail = "Handwriting Synthesis - Mimic anyone's handwriting!"
|
| 79 |
)
|
| 80 |
|
|
|
|
| 18 |
from PIL import Image
|
| 19 |
import tqdm
|
| 20 |
import shutil
|
| 21 |
+
|
| 22 |
+
wellcomingMessage = """
|
| 23 |
+
<h1>π₯ Handwriting Synthesis - Generate text in anyone's handwriting π₯ </h1>
|
| 24 |
+
<p>π This app is a demo of the ICCV'21 papar "Handwriting Transformer". Visit our github paper for more information - <a href="https://github.com/ankanbhunia/Handwriting-Transformers" target="_blank">https://github.com/ankanbhunia/Handwriting-Transformers</a></p>
|
| 25 |
+
<p>π You can either choose from an existing style gallery or upload your own handwriting. If you choose to upload, please ensure that you provide a sufficient number of (~15) cropped handwritten word images for the model to work effectively. The demo is made available for research purposes, and any other use is not intended.</p>
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
model_path = 'files/iam_model.pth'
|
| 29 |
|
| 30 |
+
|
| 31 |
batch_size = 1
|
| 32 |
print ('(1) Loading model...')
|
| 33 |
model = TRGAN(batch_size = batch_size)
|
|
|
|
| 83 |
outputs=[#gr.Markdown("## Output"),
|
| 84 |
gr.Image(type="pil", label="Style Image"),
|
| 85 |
gr.Image(type="pil", label="Generated Image")],
|
| 86 |
+
description = wellcomingMessage,
|
| 87 |
thumbnail = "Handwriting Synthesis - Mimic anyone's handwriting!"
|
| 88 |
)
|
| 89 |
|