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

Method get_BLIP_caption

visual_chatgpt.py:1203–1208  ·  view source on GitHub ↗
(self, image)

Source from the content-addressed store, hash-verified

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. " \

Callers 1

get_imagine_captionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected