mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
Merge branch 'master' of https://github.com/gradio-app/gradio
This commit is contained in:
commit
ecb1143d98
@ -5,3 +5,4 @@ requests
|
||||
psutil
|
||||
paramiko
|
||||
scipy
|
||||
IPython
|
||||
|
@ -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:
|
||||
|
@ -135,8 +135,7 @@ class Interface:
|
||||
Method that calls the relevant method of the model object to make a prediction.
|
||||
:param preprocessed_input: the preprocessed input returned by the input interface
|
||||
"""
|
||||
|
||||
# print(preprocessed_input.shape)
|
||||
# print(preprocessed_input.shape)
|
||||
if self.model_type == "sklearn":
|
||||
return self.model_obj.predict(preprocessed_input)
|
||||
elif self.model_type == "keras":
|
||||
@ -252,12 +251,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