Commit
·
c1d0660
1
Parent(s):
1d68efb
Update Gradio interface to disable analytics for simplicity and specify API endpoint name for image generation, while ensuring external access and standard port usage for Hugging Face Spaces.
Browse files
app.py
CHANGED
@@ -207,7 +207,7 @@ _DESCRIPTION = '''
|
|
207 |
'''
|
208 |
|
209 |
# Create Gradio interface
|
210 |
-
with gr.Blocks() as demo:
|
211 |
gr.Markdown("# CRM: Single Image to 3D Textured Mesh with Convolutional Reconstruction Model")
|
212 |
gr.Markdown(_DESCRIPTION)
|
213 |
with gr.Row():
|
@@ -277,11 +277,15 @@ with gr.Blocks() as demo:
|
|
277 |
image_output,
|
278 |
xyz_output,
|
279 |
output_model
|
280 |
-
]
|
|
|
281 |
)
|
282 |
|
283 |
-
# Launch the interface
|
284 |
-
demo.launch(
|
|
|
|
|
|
|
285 |
show_error=True,
|
286 |
max_threads=1
|
287 |
)
|
|
|
207 |
'''
|
208 |
|
209 |
# Create Gradio interface
|
210 |
+
with gr.Blocks(analytics_enabled=False) as demo: # Disable analytics to reduce complexity
|
211 |
gr.Markdown("# CRM: Single Image to 3D Textured Mesh with Convolutional Reconstruction Model")
|
212 |
gr.Markdown(_DESCRIPTION)
|
213 |
with gr.Row():
|
|
|
277 |
image_output,
|
278 |
xyz_output,
|
279 |
output_model
|
280 |
+
],
|
281 |
+
api_name="generate" # Give the endpoint a specific name
|
282 |
)
|
283 |
|
284 |
+
# Launch the interface with necessary parameters for Hugging Face Spaces
|
285 |
+
demo.queue(concurrency_count=1).launch(
|
286 |
+
server_name="0.0.0.0", # Allow external access
|
287 |
+
server_port=7860, # Use the standard Gradio port
|
288 |
+
share=True, # Required for Hugging Face Spaces
|
289 |
show_error=True,
|
290 |
max_threads=1
|
291 |
)
|