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

Naive fix for improperly formatted image input. #4211

Closed
wants to merge 1 commit into from

Conversation

Symbiomatrix
Copy link

@Symbiomatrix Symbiomatrix commented May 14, 2023

Description

Please include:

  • Motivation: Can't override an uploadable image + sketch via a component; after 2-3 calls the image turns into a base64 str in preprocess and fails the assertion until it is emptied.
  • Summary: Wraps base64 string (no validation) as an {image, mask}. Mask is copied from image currently. Might be preferable to set it to some blank value, but in base64 it's a drag. None causes an error down the line, in mask_im; I'd alter this as well but consequences are unclear.
  • Fixes: Cannot override upload image + sketch, NoneType attributeerror. #4088 .
  • Dependencies: None.

Closes: #4088

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.

Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.

Wraps base64 string (no validation) as an {image, mask}. Mask is copied from image currently. Might be preferable to set it to some blank value, but in base64 it's a drag. None causes an error down the line, in mask_im; I'd alter this as well but consequences are unclear.
@abidlabs
Copy link
Member

This is not an appropriate fix. We need to understand why the data is being sent in a string format from the frontend instead of a dictionary format. @pngwn is looking into this issue, so I'll close this PR

@abidlabs abidlabs closed this May 15, 2023
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.

Cannot override upload image + sketch, NoneType attributeerror.
2 participants