-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix null images #2647
Fix null images #2647
Conversation
@@ -499,7 +499,7 @@ def transform_image( | |||
if col_type == ROIS: | |||
processed_data = df[col_name].tolist() | |||
elif col_type in [IMAGE_PATH, IMAGE]: | |||
processed_data = col_value.apply(lambda ele: ele.split(";")).tolist() | |||
processed_data = col_value.apply(lambda ele: str(ele).split(";")).tolist() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will convert the None value to ["None"], will that introduce issue during training as the image can't be loaded or we will just ignore invalid path later on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be guarded by
autogluon/multimodal/src/autogluon/multimodal/data/process_image.py
Lines 359 to 365 in 70dd543
try: | |
if feature_modalities.get(per_col_name) == IMAGE_BYTEARRAY: | |
image_feature = BytesIO(img_feature) | |
else: | |
image_feature = img_feature | |
with PIL.Image.open(image_feature) as img: | |
img = img.convert(image_mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would try to open the images and skip them if failures happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as a simple fix. However, we will need to handle/test missing values for all column types (including ROI / entity). Also CC @FANGAreNotGnu @cheungdaven
Job PR-2647-acb6764 is done. |
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.