Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -73,7 +73,10 @@ def preprocess(img: Image.Image) -> np.ndarray:
73
  x = (x - np.array([0.485, 0.456, 0.406], dtype=np.float32)) / np.array(
74
  [0.229, 0.224, 0.225], dtype=np.float32
75
  )
76
- return np.transpose(x, (2, 0, 1))
 
 
 
77
 
78
  def main():
79
  ap = argparse.ArgumentParser()
 
73
  x = (x - np.array([0.485, 0.456, 0.406], dtype=np.float32)) / np.array(
74
  [0.229, 0.224, 0.225], dtype=np.float32
75
  )
76
+ # Expand dimensions to create NHWC 4D tensor: (1, 299, 299, 3)
77
+ x = np.expand_dims(x, axis=0)
78
+
79
+ return x
80
 
81
  def main():
82
  ap = argparse.ArgumentParser()