mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
fixed failing sketchpad validation test
This commit is contained in:
parent
a0238bfc46
commit
1fb8b34711
@ -95,7 +95,7 @@ class Sketchpad(AbstractInput):
|
||||
Default preprocessing method for the SketchPad is to convert the sketch to black and white and resize 28x28
|
||||
"""
|
||||
im_transparent = preprocessing_utils.decode_base64_to_image(inp)
|
||||
im = Image.new("RGBA", im_transparent.size, "WHITE") # Create a white rgba background
|
||||
im = Image.new("RGBA", im_transparent.size, "WHITE") # Create a white background for the alpha channel
|
||||
im.paste(im_transparent, (0, 0), im_transparent)
|
||||
im = im.convert('L')
|
||||
if self.invert_colors:
|
||||
|
@ -249,12 +249,17 @@ class Interface:
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
current_pkg_version = pkg_resources.require("gradio")[0].version
|
||||
latest_pkg_version = requests.get(url=PKG_VERSION_URL).json()["version"]
|
||||
if StrictVersion(latest_pkg_version) > StrictVersion(current_pkg_version):
|
||||
print(f"IMPORTANT: You are using gradio version {current_pkg_version}, however version {latest_pkg_version} "
|
||||
f"is available, please upgrade.")
|
||||
print('--------')
|
||||
try:
|
||||
current_pkg_version = pkg_resources.require("gradio")[0].version
|
||||
latest_pkg_version = requests.get(url=PKG_VERSION_URL).json()["version"]
|
||||
if StrictVersion(latest_pkg_version) > StrictVersion(current_pkg_version):
|
||||
print(f"IMPORTANT: You are using gradio version {current_pkg_version}, "
|
||||
f"however version {latest_pkg_version} "
|
||||
f"is available, please upgrade.")
|
||||
print('--------')
|
||||
except: # TODO(abidlabs): don't catch all exceptions
|
||||
pass
|
||||
|
||||
if self.verbose:
|
||||
print(strings.en["BETA_MESSAGE"])
|
||||
if not is_colab:
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user