(self, image_path)
| 311 | description="useful when you want to know what is inside the photo. receives image_path as input. " |
| 312 | "The input to this tool should be a string, representing the image_path. ") |
| 313 | def inference(self, image_path): |
| 314 | inputs = self.processor(Image.open(image_path), return_tensors="pt").to(self.device, self.torch_dtype) |
| 315 | out = self.model.generate(**inputs) |
| 316 | captions = self.processor.decode(out[0], skip_special_tokens=True) |
| 317 | print(f"\nProcessed ImageCaptioning, Input Image: {image_path}, Output Text: {captions}") |
| 318 | return captions |
| 319 | |
| 320 | |
| 321 | class Image2Canny: |
nothing calls this directly
no outgoing calls
no test coverage detected