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

Method inference

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

Source from the content-addressed store, hash-verified

655 "or detect the depth map on this image, or predict the depth for this image. "
656 "The input to this tool should be a string, representing the image_path")
657 def inference(self, inputs):
658 image = Image.open(inputs)
659 depth = self.depth_estimator(image)['depth']
660 depth = np.array(depth)
661 depth = depth[:, :, None]
662 depth = np.concatenate([depth, depth, depth], axis=2)
663 depth = Image.fromarray(depth)
664 updated_image_path = get_new_image_name(inputs, func_name="depth")
665 depth.save(updated_image_path)
666 print(f"\nProcessed Image2Depth, Input Image: {inputs}, Output Depth: {updated_image_path}")
667 return updated_image_path
668
669
670class DepthText2Image:

Callers

nothing calls this directly

Calls 1

get_new_image_nameFunction · 0.85

Tested by

no test coverage detected