This commit is contained in:
Ali Abid 2019-07-21 21:15:27 -07:00
commit ecb1143d98
4 changed files with 16 additions and 10 deletions

View File

@ -5,3 +5,4 @@ requests
psutil
paramiko
scipy
IPython

View File

@ -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:

View File

@ -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