Spaces:
Running on Zero
Running on Zero
Add type hints required by gr.api
Browse files
app.py
CHANGED
|
@@ -168,9 +168,11 @@ def restore(image):
|
|
| 168 |
image.width, image.height, n, t_inf, t_inf / max(n, 1))
|
| 169 |
|
| 170 |
|
| 171 |
-
def restore_api(image):
|
| 172 |
"""Lean endpoint for a standalone front end: the restored photo only.
|
| 173 |
|
|
|
|
|
|
|
| 174 |
The caller already holds the original, so echoing it back would double the
|
| 175 |
download for nothing. Returned as PNG, so nothing is re-compressed.
|
| 176 |
"""
|
|
|
|
| 168 |
image.width, image.height, n, t_inf, t_inf / max(n, 1))
|
| 169 |
|
| 170 |
|
| 171 |
+
def restore_api(image: Image.Image) -> Image.Image:
|
| 172 |
"""Lean endpoint for a standalone front end: the restored photo only.
|
| 173 |
|
| 174 |
+
Type hints are required: gr.api refuses to register an endpoint without them.
|
| 175 |
+
|
| 176 |
The caller already holds the original, so echoing it back would double the
|
| 177 |
download for nothing. Returned as PNG, so nothing is re-compressed.
|
| 178 |
"""
|