siriuszeina commited on
Commit
b2bc102
·
verified ·
1 Parent(s): 9dd6fc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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
- img = 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)
 
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)