Legola commited on
Commit
0cf2dbd
·
1 Parent(s): e87d8a8

Update app.py

Browse files

Changed the default values of the input style and content image

Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -98,8 +98,14 @@ example_list = [["examples/" + example] for example in os.listdir("examples")]
98
 
99
 
100
  #Defining the predict function
101
- def style_transfer(cont_img:Image.Image=torch.zeros((1,128,128)).detach().numpy(),styl_img:Image.Image=torch.zeros((1,128,128)).detach().numpy()) -> Image.Image:
102
-
 
 
 
 
 
 
103
  #Start the timer
104
  start_time = time.time()
105
 
 
98
 
99
 
100
  #Defining the predict function
101
+ def style_transfer(cont_img:Image.Image=None,styl_img:Image.Image=None) -> Image.Image:
102
+
103
+ if cont_img is None or styl_img is None:
104
+ # Handle the default behavior when inputs are not provided
105
+ # For example, you can load default images or return an error message
106
+ # Return a default output image or error message
107
+ return default_output_image
108
+
109
  #Start the timer
110
  start_time = time.time()
111