Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import argparse
|
2 |
import os
|
3 |
-
|
|
|
4 |
import gradio as gr
|
5 |
import huggingface_hub
|
6 |
import numpy as np
|
@@ -173,8 +174,8 @@ class Predictor:
|
|
173 |
character_mcut_enabled,
|
174 |
):
|
175 |
self.load_model(model_repo)
|
176 |
-
|
177 |
-
image = self.prepare_image(image)
|
178 |
|
179 |
input_name = self.model.get_inputs()[0].name
|
180 |
label_name = self.model.get_outputs()[0].name
|
|
|
1 |
import argparse
|
2 |
import os
|
3 |
+
import io
|
4 |
+
import url lib.request
|
5 |
import gradio as gr
|
6 |
import huggingface_hub
|
7 |
import numpy as np
|
|
|
174 |
character_mcut_enabled,
|
175 |
):
|
176 |
self.load_model(model_repo)
|
177 |
+
|
178 |
+
image = self.prepare_image(Image.open(io.BytesIO(urllib.request.urlopen(image).read())))
|
179 |
|
180 |
input_name = self.model.get_inputs()[0].name
|
181 |
label_name = self.model.get_outputs()[0].name
|