MCPcopy Index your code
hub / github.com/chenfei-wu/TaskMatrix / inference

Method inference

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

Source from the content-addressed store, hash-verified

330 "or perform edge detection on this image, or detect the canny image of this image. "
331 "The input to this tool should be a string, representing the image_path")
332 def inference(self, inputs):
333 image = Image.open(inputs)
334 image = np.array(image)
335 canny = cv2.Canny(image, self.low_threshold, self.high_threshold)
336 canny = canny[:, :, None]
337 canny = np.concatenate([canny, canny, canny], axis=2)
338 canny = Image.fromarray(canny)
339 updated_image_path = get_new_image_name(inputs, func_name="edge")
340 canny.save(updated_image_path)
341 print(f"\nProcessed Image2Canny, Input Image: {inputs}, Output Text: {updated_image_path}")
342 return updated_image_path
343
344
345class CannyText2Image:

Callers

nothing calls this directly

Calls 1

get_new_image_nameFunction · 0.85

Tested by

no test coverage detected