Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -86,17 +86,25 @@ demo = gr.Interface(
|
|
| 86 |
|
| 87 |
**API Usage:**
|
| 88 |
```bash
|
| 89 |
-
curl -X POST "https://YOUR-SPACE.hf.space/remove-bg"
|
| 90 |
-
-F "file=@image.png"
|
| 91 |
-o output.png
|
| 92 |
```
|
| 93 |
""",
|
| 94 |
examples=[],
|
| 95 |
-
|
|
|
|
|
|
|
| 96 |
)
|
| 97 |
|
| 98 |
# Mount Gradio app to FastAPI
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
# Add custom FastAPI endpoint for direct HTTP access
|
| 102 |
@app.post("/remove-bg")
|
|
@@ -144,5 +152,5 @@ if __name__ == "__main__":
|
|
| 144 |
demo.launch(
|
| 145 |
server_name="0.0.0.0",
|
| 146 |
server_port=7860,
|
| 147 |
-
|
| 148 |
-
)
|
|
|
|
| 86 |
|
| 87 |
**API Usage:**
|
| 88 |
```bash
|
| 89 |
+
curl -X POST "https://YOUR-SPACE.hf.space/remove-bg" \
|
| 90 |
+
-F "file=@image.png" \
|
| 91 |
-o output.png
|
| 92 |
```
|
| 93 |
""",
|
| 94 |
examples=[],
|
| 95 |
+
flagging_mode="never",
|
| 96 |
+
api_visibility="public",
|
| 97 |
+
api_name="remove_background"
|
| 98 |
)
|
| 99 |
|
| 100 |
# Mount Gradio app to FastAPI
|
| 101 |
+
fastapi_app = FastAPI()
|
| 102 |
+
app = gr.mount_gradio_app(
|
| 103 |
+
fastapi_app,
|
| 104 |
+
demo,
|
| 105 |
+
path="/",
|
| 106 |
+
footer_links=["api", "gradio", "settings"]
|
| 107 |
+
)
|
| 108 |
|
| 109 |
# Add custom FastAPI endpoint for direct HTTP access
|
| 110 |
@app.post("/remove-bg")
|
|
|
|
| 152 |
demo.launch(
|
| 153 |
server_name="0.0.0.0",
|
| 154 |
server_port=7860,
|
| 155 |
+
footer_links=["api", "gradio", "settings"]
|
| 156 |
+
)
|