Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ labels = load_labels()
|
|
46 |
def predict(url: str, score_threshold: float) -> tuple[dict[str, float], dict[str, float], str]:
|
47 |
_, height, width, _ = model.input_shape
|
48 |
response = requests.get(url)
|
49 |
-
|
50 |
|
51 |
image = np.asarray(image)
|
52 |
image = tf.image.resize(image, size=(height, width), method=tf.image.ResizeMethod.AREA, preserve_aspect_ratio=True)
|
|
|
46 |
def predict(url: str, score_threshold: float) -> tuple[dict[str, float], dict[str, float], str]:
|
47 |
_, height, width, _ = model.input_shape
|
48 |
response = requests.get(url)
|
49 |
+
image = PIL.Image.open(BytesIO(response.content))
|
50 |
|
51 |
image = np.asarray(image)
|
52 |
image = tf.image.resize(image, size=(height, width), method=tf.image.ResizeMethod.AREA, preserve_aspect_ratio=True)
|