MCPcopy Create free account
hub / github.com/chenfei-wu/TaskMatrix / get_BLIP_vqa

Method get_BLIP_vqa

visual_chatgpt.py:1195–1201  ·  view source on GitHub ↗
(self, image, question)

Source from the content-addressed store, hash-verified

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,

Callers 1

get_imagine_captionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected