MCPcopy
hub / github.com/chenfei-wu/TaskMatrix / inference

Method inference

visual_chatgpt.py:1298–1308  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

1296 "The input to this tool should be a comma separated string of two, "
1297 "representing the image_path, the text description of the object to be found")
1298 def inference(self, inputs):
1299 image_path, det_prompt = inputs.split(",")
1300 print(f"image_path={image_path}, text_prompt={det_prompt}")
1301 image_pil, image = self.grounding.load_image(image_path)
1302
1303 boxes_filt, pred_phrases = self.grounding.get_grounding_boxes(image, det_prompt)
1304 updated_image_path = self.sam.segment_image_with_boxes(image_pil,image_path,boxes_filt,pred_phrases)
1305 print(
1306 f"\nProcessed ObejectSegmenting, Input Image: {image_path}, Object to be Segment {det_prompt}, "
1307 f"Output Image: {updated_image_path}")
1308 return updated_image_path
1309
1310 def merge_masks(self, masks):
1311 '''

Callers

nothing calls this directly

Calls 3

load_imageMethod · 0.80
get_grounding_boxesMethod · 0.80

Tested by

no test coverage detected