Commit
·
c3653b9
1
Parent(s):
2930bea
Update main.py
Browse files
main.py
CHANGED
@@ -12,11 +12,11 @@ def remove_background(input_image):
|
|
12 |
inputs = gr.inputs.Image()
|
13 |
outputs = gr.outputs.Image(type='pil')
|
14 |
|
15 |
-
interface = gr.Interface(fn=remove_background, inputs=inputs, outputs=outputs, title="Remove Background", description="This App removes the background from an image.", api="flask")
|
16 |
interface.launch()
|
17 |
|
18 |
@app.route("/api/remove-background", methods=["POST"])
|
19 |
def remove_background_api():
|
20 |
input_image = Image.open(request.files["input"])
|
21 |
output_image = remove_background(input_image)
|
22 |
-
return jsonify({"output": output_image})
|
|
|
12 |
inputs = gr.inputs.Image()
|
13 |
outputs = gr.outputs.Image(type='pil')
|
14 |
|
15 |
+
interface = gr.Interface(fn=remove_background, inputs=inputs, outputs=outputs, title="Remove Background", description="This App removes the background from an image.", api="flask", api_description="To use this API, send a POST request to the '/api/remove-background' endpoint with an image file in the 'input' field of the request body.")
|
16 |
interface.launch()
|
17 |
|
18 |
@app.route("/api/remove-background", methods=["POST"])
|
19 |
def remove_background_api():
|
20 |
input_image = Image.open(request.files["input"])
|
21 |
output_image = remove_background(input_image)
|
22 |
+
return jsonify({"output": output_image})
|