Skip to content

refactor: remove tensorflow dependency from vision image preprocessing#591

Open
irhyl wants to merge 1 commit intogoogle-deepmind:mainfrom
gsoc-2026:refactor/remove-tf-vision
Open

refactor: remove tensorflow dependency from vision image preprocessing#591
irhyl wants to merge 1 commit intogoogle-deepmind:mainfrom
gsoc-2026:refactor/remove-tf-vision

Conversation

@irhyl
Copy link

@irhyl irhyl commented Feb 26, 2026

Replace tf.image.decode_jpeg/tf.io.encode_jpeg JPEG round-trip with PIL (Pillow) equivalent using Image.save/Image.open via BytesIO.

This eliminates the only direct tensorflow import in the codebase, removing a ~500MB transitive dependency that was used solely for JPEG encode/decode in a single function.

PIL (Pillow) is already imported in this file for load_image_files(), so no new dependencies are introduced.

Resolves TODO(eyvinec) on line 73.

Replace tf.image.decode_jpeg/tf.io.encode_jpeg JPEG round-trip with
PIL (Pillow) equivalent using Image.save/Image.open via BytesIO.

This eliminates the only direct tensorflow import in the codebase,
removing a ~500MB transitive dependency that was used solely for
JPEG encode/decode in a single function.

PIL (Pillow) is already imported in this file for load_image_files(),
so no new dependencies are introduced.

Resolves TODO(eyvinec) on line 73.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant