Update pipeline.py
Browse files- 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 |
-
|
|
|
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
|