qubvel-hf HF staff commited on
Commit
cedcb20
1 Parent(s): 3add5ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -209,7 +209,10 @@ def get_formatted_signature(function_or_class, indentation=4):
209
  if param.name == "p":
210
  str_param = "p=1.0,"
211
  elif param.default == inspect.Parameter.empty:
212
- str_param = f"{param.name}=,"
 
 
 
213
  else:
214
  if isinstance(param.default, str):
215
  str_param = f'{param.name}="{param.default}",'
@@ -243,7 +246,7 @@ def get_formatted_transform_docs(transform_name):
243
  def update_augmented_images(image, code):
244
 
245
  if "=," in code:
246
- raise gr.Error("You have to fill in some parameters to apply transform!")
247
 
248
  try:
249
  augmentation = eval(code)
 
209
  if param.name == "p":
210
  str_param = "p=1.0,"
211
  elif param.default == inspect.Parameter.empty:
212
+ if "height" in param.name or "width" in param.name:
213
+ str_param = f"{param.name}=300,"
214
+ else:
215
+ str_param = f"{param.name}=,"
216
  else:
217
  if isinstance(param.default, str):
218
  str_param = f'{param.name}="{param.default}",'
 
246
  def update_augmented_images(image, code):
247
 
248
  if "=," in code:
249
+ raise gr.Error("You have to fill in parameters to apply transform! See 'Code' section!")
250
 
251
  try:
252
  augmentation = eval(code)