A simple pipeline to load image.
| 40 | |
| 41 | |
| 42 | class LoadImage: |
| 43 | """A simple pipeline to load image.""" |
| 44 | |
| 45 | def __call__(self, results): |
| 46 | """Call function to load images into results. |
| 47 | |
| 48 | Args: |
| 49 | results (dict): A result dict contains the file name |
| 50 | of the image to be read. |
| 51 | |
| 52 | Returns: |
| 53 | dict: ``results`` will be returned containing loaded image. |
| 54 | """ |
| 55 | |
| 56 | if isinstance(results["img"], str): |
| 57 | results["filename"] = results["img"] |
| 58 | results["ori_filename"] = results["img"] |
| 59 | else: |
| 60 | results["filename"] = None |
| 61 | results["ori_filename"] = None |
| 62 | img = mmcv.imread(results["img"]) |
| 63 | results["img"] = img |
| 64 | results["img_shape"] = img.shape |
| 65 | results["ori_shape"] = img.shape |
| 66 | return results |
| 67 | |
| 68 | |
| 69 | def inference_segmentor(model, imgs): |
no outgoing calls
no test coverage detected