hoangthan commited on
Commit
1199618
1 Parent(s): a134d0c

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +2 -1
pipeline.py CHANGED
@@ -36,7 +36,8 @@ class PreTrainedPipeline():
36
  A :obj:`list`:. The list contains items that are dicts should be liked {"label": "XXX", "score": 0.82}
37
  It is preferred if the returned list is in decreasing `score` order
38
  """
39
- image = load_image(inputs)
 
40
  initial = self.word_to_index([['[START]']]) # (batch, sequence)
41
  img_features = self.model.feature_extractor(image[tf.newaxis, ...])
42
  temperature = 0
 
36
  A :obj:`list`:. The list contains items that are dicts should be liked {"label": "XXX", "score": 0.82}
37
  It is preferred if the returned list is in decreasing `score` order
38
  """
39
+ img_array = tf.keras.utils.img_to_array(inputs)
40
+ image = load_image(img_array)
41
  initial = self.word_to_index([['[START]']]) # (batch, sequence)
42
  img_features = self.model.feature_extractor(image[tf.newaxis, ...])
43
  temperature = 0