Spaces:
Configuration error
Configuration error
Decode urls
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import os
|
|
| 8 |
import subprocess
|
| 9 |
import requests
|
| 10 |
import PIL
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
def download_image(url) -> PIL.Image.Image:
|
|
@@ -22,7 +23,7 @@ def image_to_sam_image_embedding(
|
|
| 22 |
) -> str:
|
| 23 |
"""Generate an image embedding."""
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
image = download_image(image_url)
|
| 28 |
image = image.convert("RGB")
|
|
|
|
| 8 |
import subprocess
|
| 9 |
import requests
|
| 10 |
import PIL
|
| 11 |
+
import urllib.parse
|
| 12 |
|
| 13 |
|
| 14 |
def download_image(url) -> PIL.Image.Image:
|
|
|
|
| 23 |
) -> str:
|
| 24 |
"""Generate an image embedding."""
|
| 25 |
|
| 26 |
+
image_url = urllib.parse.unquote(image_url)
|
| 27 |
|
| 28 |
image = download_image(image_url)
|
| 29 |
image = image.convert("RGB")
|