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