jableable commited on
Commit
187260e
·
verified ·
1 Parent(s): 096e4b4

Update new_app.py

Browse files
Files changed (1) hide show
  1. new_app.py +1 -2
new_app.py CHANGED
@@ -26,8 +26,7 @@ def get_model():
26
  return keras.models.load_model("0.0008-0.92.keras", compile=False)
27
 
28
  def preprocess(img: Image.Image, size=(640, 640)) -> np.ndarray:
29
- img = img.resize(size, Image.BILINEAR)
30
- arr = np.asarray(img, dtype=np.float32) / 255.0
31
  return np.expand_dims(arr, axis=0)
32
 
33
  def status_text(pct: float) -> str:
 
26
  return keras.models.load_model("0.0008-0.92.keras", compile=False)
27
 
28
  def preprocess(img: Image.Image, size=(640, 640)) -> np.ndarray:
29
+ arr = np.asarray(img, dtype=np.float32) # no /255.0, no resize
 
30
  return np.expand_dims(arr, axis=0)
31
 
32
  def status_text(pct: float) -> str: