Jim Dowling commited on
Commit
ad21bf1
·
1 Parent(s): 6a24177
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -17,23 +17,23 @@ mr = project.get_model_registry()
17
 
18
  #get the version number for the latest model
19
  version = mr.get_models(name)[-1].version
20
- # Specify the local file path of the Python script to be uploaded
21
- img_path = f"Models/{name}/{version}/images/{img}"
22
 
23
- # Upload the Python script to the "Models", and overwrite if it already exists
24
- downloaded_file_path = dataset_api.download(img_path, overwrite=True)
25
 
26
 
27
 
 
 
 
28
 
29
- def show_image(dummy):
30
- image = Image.open(f"{img}")
 
31
  return image
32
 
33
  # Define the Gradio interface
34
  iface = gr.Interface(
35
  fn=show_image,
36
- inputs="text",
37
  outputs="image",
38
  title="Display PNG Image",
39
  )
 
17
 
18
  #get the version number for the latest model
19
  version = mr.get_models(name)[-1].version
 
 
20
 
 
 
21
 
22
 
23
 
24
+ def show_image(img):
25
+ # Specify the local file path of the Python script to be uploaded
26
+ img_path = f"Models/{name}/{version}/images/{img}.png"
27
 
28
+ # Upload the Python script to the "Models", and overwrite if it already exists
29
+ downloaded_file_path = dataset_api.download(img_path, overwrite=True)
30
+ image = Image.open(f"{img}.png")
31
  return image
32
 
33
  # Define the Gradio interface
34
  iface = gr.Interface(
35
  fn=show_image,
36
+ inputs=gr.Textbox(default="fig2", label="Image Name"),
37
  outputs="image",
38
  title="Display PNG Image",
39
  )