Skip to content

Commit

Permalink
make jpeg encoding more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
n3011 committed May 10, 2024
1 parent 764921f commit 900e785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions datum/reader/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion datum/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 900e785

Please sign in to comment.