Spaces:
adpro
/
Runtime error

adpro commited on
Commit
76111e7
1 Parent(s): afe825a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -33,9 +33,9 @@ def inference(img_path, Style, if_face=None):
33
  det_face = True if if_face=="Yes" else False
34
  output = AnimeGANv3_src.Convert(img, f, det_face)
35
  result = cv2.resize(output, (img.shape[1],img.shape[0] ), interpolation = cv2.INTER_AREA)
36
- save_path = f"output/out.{img_path.rsplit('.')[-1]}"
37
- cv2.imwrite(save_path, result[:, :, ::-1])
38
- return result, save_path
39
  except RuntimeError as error:
40
  print('Error', error)
41
  except Exception as error:
@@ -91,7 +91,7 @@ gr.Interface(
91
  gr.inputs.Radio(['Yes', 'No'], type="value", default='No', label='Extract face'),
92
  ], [
93
  gr.outputs.Image(type="numpy", label="Output (The whole image)"),
94
- gr.outputs.File(label="Download the output image")
95
  ],
96
  title=title,
97
  description=description,
 
33
  det_face = True if if_face=="Yes" else False
34
  output = AnimeGANv3_src.Convert(img, f, det_face)
35
  result = cv2.resize(output, (img.shape[1],img.shape[0] ), interpolation = cv2.INTER_AREA)
36
+ # save_path = f"output/out.{img_path.rsplit('.')[-1]}"
37
+ #cv2.imwrite(save_path, result[:, :, ::-1])
38
+ return result
39
  except RuntimeError as error:
40
  print('Error', error)
41
  except Exception as error:
 
91
  gr.inputs.Radio(['Yes', 'No'], type="value", default='No', label='Extract face'),
92
  ], [
93
  gr.outputs.Image(type="numpy", label="Output (The whole image)"),
94
+ # gr.outputs.File(label="Download the output image")
95
  ],
96
  title=title,
97
  description=description,