| 1193 | 'fewer digits, cropped, worst quality, low quality' |
| 1194 | |
| 1195 | def get_BLIP_vqa(self, image, question): |
| 1196 | inputs = self.ImageVQA.processor(image, question, return_tensors="pt").to(self.ImageVQA.device, |
| 1197 | self.ImageVQA.torch_dtype) |
| 1198 | out = self.ImageVQA.model.generate(**inputs) |
| 1199 | answer = self.ImageVQA.processor.decode(out[0], skip_special_tokens=True) |
| 1200 | print(f"\nProcessed VisualQuestionAnswering, Input Question: {question}, Output Answer: {answer}") |
| 1201 | return answer |
| 1202 | |
| 1203 | def get_BLIP_caption(self, image): |
| 1204 | inputs = self.ImageCaption.processor(image, return_tensors="pt").to(self.ImageCaption.device, |