Skip to content

Commit

Permalink
Allow image bytes type during preprocessing (#3971)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayi1 authored Mar 22, 2024
1 parent 9eba97e commit 437732f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ludwig/features/image_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,9 @@ def _finalize_preprocessing_parameters(
sample_num_bytes = []
failed_entries = []
for image_entry in column.head(sample_size):
if isinstance(image_entry, str):
if isinstance(image_entry, bytes):
image = read_image_from_bytes_obj(image_entry)
elif isinstance(image_entry, str):
# Tries to read image as PNG or numpy file from the path.
image, num_bytes = read_image_from_path(image_entry, return_num_bytes=True)
if num_bytes is not None:
Expand Down

0 comments on commit 437732f

Please sign in to comment.