(self, inputs)
| 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 | |
| 670 | class DepthText2Image: |
nothing calls this directly
no test coverage detected