예제 #1
0
파일: _encoded.py 프로젝트: liuf1990/vision
    def decode(self) -> Image:
        # TODO: this is useful for developing and debugging but we should remove or at least revisit this before we
        #  promote this out of the prototype state

        # import at runtime to avoid cyclic imports
        from torchvision.prototype.transforms.functional import decode_image_with_pil

        return Image(decode_image_with_pil(self))
예제 #2
0
 def _transform(self, input: Any, params: Dict[str, Any]) -> Any:
     if type(input) is features.EncodedImage:
         output = F.decode_image_with_pil(input)
         return features.Image(output)
     else:
         return input