Spaces:
Running
Running
Add HuggingFace-style submission form
Browse files
app.py
CHANGED
|
@@ -244,5 +244,125 @@ with demo:
|
|
| 244 |
build_tab(SEGMENTATION_DATA, "π
Segmentation")
|
| 245 |
build_tab(DETECTION_DATA, "π
Object Detection")
|
| 246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
if __name__ == "__main__":
|
| 248 |
demo.launch()
|
|
|
|
| 244 |
build_tab(SEGMENTATION_DATA, "π
Segmentation")
|
| 245 |
build_tab(DETECTION_DATA, "π
Object Detection")
|
| 246 |
|
| 247 |
+
with gr.TabItem("π Submit", elem_id="submit-tab"):
|
| 248 |
+
gr.Markdown("""
|
| 249 |
+
# Submit Your Model Results
|
| 250 |
+
|
| 251 |
+
To submit your model's results to the Mars Vision Leaderboard, please provide the following information.
|
| 252 |
+
All submissions will be reviewed before being added to the leaderboard.
|
| 253 |
+
|
| 254 |
+
**After filling out this form, click "Generate Submission Text" and then open a discussion on this Space's Community tab with the generated text.**
|
| 255 |
+
""")
|
| 256 |
+
|
| 257 |
+
with gr.Row():
|
| 258 |
+
with gr.Column():
|
| 259 |
+
submit_task = gr.Dropdown(
|
| 260 |
+
choices=["Classification", "Segmentation", "Object Detection"],
|
| 261 |
+
label="Task Type",
|
| 262 |
+
info="Select the task category"
|
| 263 |
+
)
|
| 264 |
+
submit_model = gr.Textbox(
|
| 265 |
+
label="Model Name",
|
| 266 |
+
placeholder="e.g., ResNet-50",
|
| 267 |
+
info="Name of your model"
|
| 268 |
+
)
|
| 269 |
+
submit_org = gr.Textbox(
|
| 270 |
+
label="Organization",
|
| 271 |
+
placeholder="e.g., Microsoft, Google",
|
| 272 |
+
info="Your organization or affiliation"
|
| 273 |
+
)
|
| 274 |
+
submit_dataset = gr.Textbox(
|
| 275 |
+
label="Dataset",
|
| 276 |
+
placeholder="e.g., DoMars16, Mars Crater",
|
| 277 |
+
info="Dataset used for evaluation"
|
| 278 |
+
)
|
| 279 |
+
|
| 280 |
+
with gr.Column():
|
| 281 |
+
submit_metrics = gr.Textbox(
|
| 282 |
+
label="Metrics (JSON format)",
|
| 283 |
+
placeholder='{"Accuracy": 95.8, "F1-Score": 94.9}',
|
| 284 |
+
info="Provide metrics in JSON format",
|
| 285 |
+
lines=3
|
| 286 |
+
)
|
| 287 |
+
submit_paper = gr.Textbox(
|
| 288 |
+
label="Paper Link (Optional)",
|
| 289 |
+
placeholder="https://arxiv.org/abs/...",
|
| 290 |
+
info="Link to your research paper"
|
| 291 |
+
)
|
| 292 |
+
submit_code = gr.Textbox(
|
| 293 |
+
label="Code Repository (Optional)",
|
| 294 |
+
placeholder="https://github.com/...",
|
| 295 |
+
info="Link to your code repository"
|
| 296 |
+
)
|
| 297 |
+
submit_email = gr.Textbox(
|
| 298 |
+
label="Contact Email",
|
| 299 |
+
placeholder="your.email@example.com",
|
| 300 |
+
info="We'll contact you about your submission"
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
submit_notes = gr.Textbox(
|
| 304 |
+
label="Additional Notes (Optional)",
|
| 305 |
+
placeholder="Training details, hyperparameters, reproduction instructions...",
|
| 306 |
+
lines=4,
|
| 307 |
+
info="Any additional information"
|
| 308 |
+
)
|
| 309 |
+
|
| 310 |
+
generate_btn = gr.Button("Generate Submission Text", variant="primary", size="lg")
|
| 311 |
+
submission_output = gr.Textbox(
|
| 312 |
+
label="Copy this text and create a new discussion in the Community tab",
|
| 313 |
+
lines=15,
|
| 314 |
+
interactive=True
|
| 315 |
+
)
|
| 316 |
+
|
| 317 |
+
gr.Markdown("""
|
| 318 |
+
### How to submit:
|
| 319 |
+
1. Fill out the form above
|
| 320 |
+
2. Click "Generate Submission Text"
|
| 321 |
+
3. Copy the generated text
|
| 322 |
+
4. Go to the [Community tab](https://huggingface.co/spaces/gremlin97/MarsBoard/discussions)
|
| 323 |
+
5. Click "New discussion"
|
| 324 |
+
6. Paste the text and submit
|
| 325 |
+
|
| 326 |
+
We'll review your submission and add it to the leaderboard if approved.
|
| 327 |
+
""")
|
| 328 |
+
|
| 329 |
+
def generate_submission_text(task, model, org, dataset, metrics, paper, code, email, notes):
|
| 330 |
+
if not all([task, model, org, dataset, metrics, email]):
|
| 331 |
+
return "β Error: Please fill in all required fields (Task Type, Model Name, Organization, Dataset, Metrics, Contact Email)"
|
| 332 |
+
|
| 333 |
+
submission_text = f"""## New Model Submission
|
| 334 |
+
|
| 335 |
+
**Task Type:** {task}
|
| 336 |
+
**Model Name:** {model}
|
| 337 |
+
**Organization:** {org}
|
| 338 |
+
**Dataset:** {dataset}
|
| 339 |
+
|
| 340 |
+
### Metrics
|
| 341 |
+
```json
|
| 342 |
+
{metrics}
|
| 343 |
+
```
|
| 344 |
+
|
| 345 |
+
### Links
|
| 346 |
+
- **Paper:** {paper if paper else "N/A"}
|
| 347 |
+
- **Code:** {code if code else "N/A"}
|
| 348 |
+
|
| 349 |
+
### Contact
|
| 350 |
+
**Email:** {email}
|
| 351 |
+
|
| 352 |
+
### Additional Notes
|
| 353 |
+
{notes if notes else "N/A"}
|
| 354 |
+
|
| 355 |
+
---
|
| 356 |
+
*Please review this submission for inclusion in the Mars Vision Leaderboard.*
|
| 357 |
+
"""
|
| 358 |
+
return submission_text
|
| 359 |
+
|
| 360 |
+
generate_btn.click(
|
| 361 |
+
generate_submission_text,
|
| 362 |
+
inputs=[submit_task, submit_model, submit_org, submit_dataset, submit_metrics,
|
| 363 |
+
submit_paper, submit_code, submit_email, submit_notes],
|
| 364 |
+
outputs=submission_output
|
| 365 |
+
)
|
| 366 |
+
|
| 367 |
if __name__ == "__main__":
|
| 368 |
demo.launch()
|