(shared_datadir, build_example)
| 65 | ], |
| 66 | ) |
| 67 | def test_image_feature_encode_example(shared_datadir, build_example): |
| 68 | import PIL.Image |
| 69 | |
| 70 | image_path = str(shared_datadir / "test_image_rgb.jpg") |
| 71 | image = Image() |
| 72 | encoded_example = image.encode_example(build_example(image_path)) |
| 73 | assert isinstance(encoded_example, dict) |
| 74 | assert encoded_example.keys() == {"bytes", "path"} |
| 75 | assert encoded_example["bytes"] is not None or encoded_example["path"] is not None |
| 76 | decoded_example = image.decode_example(encoded_example) |
| 77 | assert isinstance(decoded_example, PIL.Image.Image) |
| 78 | |
| 79 | |
| 80 | @require_pil |
nothing calls this directly
no test coverage detected