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

Found bug on Image component with sketch mode. #2124

Closed
1 task done
fladdict opened this issue Aug 30, 2022 · 0 comments · Fixed by #2144
Closed
1 task done

Found bug on Image component with sketch mode. #2124

fladdict opened this issue Aug 30, 2022 · 0 comments · Fixed by #2144
Labels
bug Something isn't working

Comments

@fladdict
Copy link

fladdict commented Aug 30, 2022

Describe the bug

Sketch mode Image components returns errors in particular situation.
When people upload image but don't use drawing pen, and run input,
Enpty mask invoke error in processing_utils.py line 28.

Beter result is returning data like {image:imagePath, mask: None}

Seems need to fix somewhere around line 1332 of components.py

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

  1. Set Image Component to Sketch mode
  2. Upload Image to Image Component
  3. Don't draw anything
  4. Press ok button to call function

Screenshot

No response

Logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/gradio/routes.py", line 249, in run_predict
    fn_index, raw_input, username, session_state
  File "/usr/local/lib/python3.7/dist-packages/gradio/blocks.py", line 641, in process_api
    processed_input = self.preprocess_data(fn_index, raw_input, state)
  File "/usr/local/lib/python3.7/dist-packages/gradio/blocks.py", line 545, in preprocess_data
    processed_input.append(block.preprocess(raw_input[i]))
  File "/usr/local/lib/python3.7/dist-packages/gradio/components.py", line 1563, in preprocess
    mask_im = processing_utils.decode_base64_to_image(mask)
  File "/usr/local/lib/python3.7/dist-packages/gradio/processing_utils.py", line 28, in decode_base64_to_image
    content = encoding.split(";")[1]
AttributeError: 'NoneType' object has no attribute 'split'

System Info

piped recent version and testet with colab.

Severity

serious, but I can work around it

@fladdict fladdict added the bug Something isn't working label Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant