Skip to content
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

[Bug] Fix image read error #3377

Merged
merged 4 commits into from
Jul 17, 2023

Conversation

Asthestarsfalll
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

fix #3376

Copy link
Collaborator

@shiyutang shiyutang left a comment

Choose a reason for hiding this comment

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

有逻辑需要修改。

Comment on lines +64 to +66
if img is None:
raise ValueError('Can\'t read The image file {}!'.format(data['img']))
data['img'] = img.astype('float32')
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个修改会导致一个不兼容问题,目前eg1800和supervisely在调用compose时传入的是传入image,而不是string,因此这样修改会导致漏掉对image的判None操作,建议:

  1. 同步修改eg1800和supervisely传入path而不是image。
  2. 加入assert指令保证img为string类型。
  3. 删除if isinstance(data['img'], str)

从而所有传入的都是sting,并在加载string后进行判断是否None,不为None则astype。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eg1800和supervisely的逻辑似乎不太方便修改为只传入string,因此多加了一个判断

shiyutang
shiyutang previously approved these changes Jul 13, 2023
Copy link
Collaborator

@shiyutang shiyutang left a comment

Choose a reason for hiding this comment

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

LGTM

@shiyutang shiyutang mentioned this pull request Jul 13, 2023
@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jul 14, 2023
@PaddlePaddle PaddlePaddle unlocked this conversation Jul 14, 2023
@shiyutang shiyutang added the contributor Contribution from developers label Jul 14, 2023
Copy link
Collaborator

@shiyutang shiyutang left a comment

Choose a reason for hiding this comment

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

LGTM

@shiyutang shiyutang merged commit b23cbca into PaddlePaddle:develop Jul 17, 2023
@shiyutang shiyutang added Contributor PR is Merged and removed contributor Contribution from developers labels Jul 26, 2023
@Ligoml Ligoml added the contributor Contribution from developers label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor PR is Merged contributor Contribution from developers
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants