merve HF staff commited on
Commit
d683f74
1 Parent(s): a19e3e5

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +1 -2
pipeline.py CHANGED
@@ -19,8 +19,7 @@ class PreTrainedPipeline():
19
  def __call__(self, inputs: "Image.Image")-> List[Dict[str, Any]]:
20
 
21
  # convert img to numpy array, resize and normalize to make the prediction
22
- with Image.open(inputs) as img:
23
- img = np.array(inputs)
24
 
25
  im = tf.image.resize(img, (128, 128))
26
  im = tf.cast(im, tf.float32) / 255.0
19
  def __call__(self, inputs: "Image.Image")-> List[Dict[str, Any]]:
20
 
21
  # convert img to numpy array, resize and normalize to make the prediction
22
+ img = np.array(inputs)
 
23
 
24
  im = tf.image.resize(img, (128, 128))
25
  im = tf.cast(im, tf.float32) / 255.0