From 900e7855a30be9f2325805713b35132252319e82 Mon Sep 17 00:00:00 2001 From: Ishant Mrinal Haloi Date: Fri, 10 May 2024 23:01:42 +0530 Subject: [PATCH] make jpeg encoding more accurate --- datum/reader/parser.py | 4 ++-- datum/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datum/reader/parser.py b/datum/reader/parser.py index b3dd8d6..181b577 100644 --- a/datum/reader/parser.py +++ b/datum/reader/parser.py @@ -112,9 +112,9 @@ def decode_example(self, parsed_example: dict[str, tf.Tensor]) -> dict[str, tf.T dtype = self.pytype_to_tftype[self.datum_to_type_shape[key]['type']] if dtype == tf.string: if len(self.datum_to_type_shape[key]['shape']) == 2: - deserialized_outputs[key] = tf.io.decode_jpeg(value, 1) + deserialized_outputs[key] = tf.io.decode_jpeg(value, 1, dct_method="INTEGER_ACCURATE") elif len(self.datum_to_type_shape[key]['shape']) == 3: - deserialized_outputs[key] = tf.io.decode_jpeg(value, 3) + deserialized_outputs[key] = tf.io.decode_jpeg(value, 3, dct_method="INTEGER_ACCURATE") elif self.datum_to_type_shape[key]['dense']: deserialized_outputs[key] = value else: diff --git a/datum/version.py b/datum/version.py index 7a2321f..260663a 100644 --- a/datum/version.py +++ b/datum/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = '1.11.0' +__version__ = '1.11.1'