Update app.py
Browse files
app.py
CHANGED
|
@@ -10,17 +10,6 @@ import cv2
|
|
| 10 |
import os
|
| 11 |
|
| 12 |
|
| 13 |
-
def load_image(image):
|
| 14 |
-
if isinstance(image, str):
|
| 15 |
-
if image.startswith("http://") or image.startswith("https://"):
|
| 16 |
-
image = PIL.Image.open(requests.get(image, stream=True).raw)
|
| 17 |
-
elif os.path.isfile(image):
|
| 18 |
-
image = PIL.Image.open(image)
|
| 19 |
-
elif isinstance(image, PIL.Image.Image):
|
| 20 |
-
image = image
|
| 21 |
-
image = PIL.ImageOps.exif_transpose(image)
|
| 22 |
-
image = image.convert("RGB")
|
| 23 |
-
return image
|
| 24 |
|
| 25 |
|
| 26 |
|
|
|
|
| 10 |
import os
|
| 11 |
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
|