Update my_model/captioner/image_captioning.py
Browse files
my_model/captioner/image_captioning.py
CHANGED
@@ -69,6 +69,14 @@ class ImageCaptioningModel:
|
|
69 |
def generate_captions_for_multiple_images(self, image_paths):
|
70 |
|
71 |
return [self.generate_caption(image_path) for image_path in image_paths]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
|
74 |
if __name__ == "__main__":
|
|
|
69 |
def generate_captions_for_multiple_images(self, image_paths):
|
70 |
|
71 |
return [self.generate_caption(image_path) for image_path in image_paths]
|
72 |
+
|
73 |
+
|
74 |
+
def get_caption(img):
|
75 |
+
captioner = ImageCaptioningModel()
|
76 |
+
captioner.load_model()
|
77 |
+
caption = captioner.generate_caption(img)
|
78 |
+
|
79 |
+
return caption
|
80 |
|
81 |
|
82 |
if __name__ == "__main__":
|