Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion verl/utils/dataset/vision_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def process_image(image: Union[dict, Image.Image]) -> Image.Image:

if "bytes" in image:
assert "image" not in image, "Cannot have both `bytes` and `image`"
image["image"] = BytesIO(image["bytes"])
return Image.open(BytesIO(image["bytes"]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The original code assigns BytesIO(image["bytes"]) to image["image"], but this change directly returns Image.open(BytesIO(image["bytes"])). Ensure that the subsequent fetch_image function is compatible with this change, as it might have been expecting a dictionary with an 'image' key.

return Image.open(BytesIO(image["bytes"]))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is okay


return fetch_image(image)

Expand Down
Loading