(self, image)
| 1201 | return answer |
| 1202 | |
| 1203 | def get_BLIP_caption(self, image): |
| 1204 | inputs = self.ImageCaption.processor(image, return_tensors="pt").to(self.ImageCaption.device, |
| 1205 | self.ImageCaption.torch_dtype) |
| 1206 | out = self.ImageCaption.model.generate(**inputs) |
| 1207 | BLIP_caption = self.ImageCaption.processor.decode(out[0], skip_special_tokens=True) |
| 1208 | return BLIP_caption |
| 1209 | |
| 1210 | def check_prompt(self, prompt): |
| 1211 | check = f"Here is a paragraph with adjectives. " \ |