user-agent commited on
Commit
c0766d3
·
verified ·
1 Parent(s): 06ce79b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -48,8 +48,8 @@ def image_to_base64(image):
48
  img_str = base64.b64encode(buffered.getvalue()).decode('utf-8')
49
  return img_str
50
 
51
- # Define the Gradio interface
52
- interface = gr.Interface(
53
  fn=crop_face,
54
  inputs="text",
55
  outputs="text",
@@ -57,13 +57,13 @@ interface = gr.Interface(
57
  description="Input a base64 encoded image to get a base64 encoded cropped face."
58
  )
59
 
60
- interface2 = gr.Interface(
61
  fn=image_to_base64,
62
- inputs=gr.inputs.Image(),
63
  outputs="text",
64
  title="Image to Base64 Converter",
65
- description="Upload an image to convert it to Base64 encoded string."
66
  )
67
 
68
  if __name__ == "__main__":
69
- gr.TabbedInterface([interface, interface2], ["Crop Face", "Convert to Base64"]).launch(share=True)
 
48
  img_str = base64.b64encode(buffered.getvalue()).decode('utf-8')
49
  return img_str
50
 
51
+ # Define the Gradio interfaces
52
+ face_crop_interface = gr.Interface(
53
  fn=crop_face,
54
  inputs="text",
55
  outputs="text",
 
57
  description="Input a base64 encoded image to get a base64 encoded cropped face."
58
  )
59
 
60
+ base64_converter_interface = gr.Interface(
61
  fn=image_to_base64,
62
+ inputs=gr.Image(),
63
  outputs="text",
64
  title="Image to Base64 Converter",
65
+ description="Upload an image to convert it to a Base64 encoded string."
66
  )
67
 
68
  if __name__ == "__main__":
69
+ gr.TabbedInterface([face_crop_interface, base64_converter_interface], ["Crop Face", "Convert to Base64"]).launch(share=True)