Description: given an image path, return the mask of the main object. Args: image_path (string): the file path of the image Outputs: mask (numpy.ndarray): H x W
(self, image_path)
| 1446 | return updated_image_path |
| 1447 | |
| 1448 | def get_mask(self, image_path): |
| 1449 | ''' |
| 1450 | Description: |
| 1451 | given an image path, return the mask of the main object. |
| 1452 | Args: |
| 1453 | image_path (string): the file path of the image |
| 1454 | Outputs: |
| 1455 | mask (numpy.ndarray): H x W |
| 1456 | ''' |
| 1457 | vqa_input = f"{image_path}, what is the main object in the image?" |
| 1458 | text_prompt = self.vqa.inference(vqa_input) |
| 1459 | |
| 1460 | mask = self.obj_segmenting.get_mask(image_path,text_prompt) |
| 1461 | |
| 1462 | return mask |
| 1463 | |
| 1464 | |
| 1465 | class ConversationBot: |