Spaces:
Build error
Build error
Commit
Β·
f318bfa
1
Parent(s):
68efe72
add instruction and mcp
Browse files
app.py
CHANGED
|
@@ -5,7 +5,23 @@ heinsight = HeinSight(vial_model_path="models/best_vessel.pt",
|
|
| 5 |
config=HeinSightConfig())
|
| 6 |
|
| 7 |
import gradio as gr
|
|
|
|
|
|
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Gradio UI
|
| 10 |
demo = gr.Interface(
|
| 11 |
fn=heinsight.image_demo,
|
|
@@ -18,9 +34,9 @@ demo = gr.Interface(
|
|
| 18 |
gr.JSON(label="Detection Info") # or gr.Textbox() if you prefer plain text
|
| 19 |
],
|
| 20 |
title="HeinSight",
|
| 21 |
-
description=
|
| 22 |
)
|
| 23 |
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
-
demo.launch()
|
|
|
|
| 5 |
config=HeinSightConfig())
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
+
description = """
|
| 9 |
+
[π HeinSight GitLab Repository](https://gitlab.com/heingroup/heinsight4.0)
|
| 10 |
|
| 11 |
+
HeinSight detects vials and their contents in a single vessel image.
|
| 12 |
+
|
| 13 |
+
**Instructions:**
|
| 14 |
+
- Upload an image of a container (e.g., a HPLC vial or a reactor).
|
| 15 |
+
- Adjust the **Cap Size Ratio** slider if there is a lid on the vial.This ratio helps the detector estimate the relative size of the vial caps.
|
| 16 |
+
- The output image will highlight detection zones with detected classes. JSON output lists contents info.
|
| 17 |
+
|
| 18 |
+
**Classifications:**
|
| 19 |
+
- **π« Empty**: No liquid; dry walls above expected fill line.
|
| 20 |
+
- **π§ Residue**: Visible solid deposit or stain above liquid level.
|
| 21 |
+
- **π₯ Homogeneous**: Clear liquid, optically uniform.
|
| 22 |
+
- **πͺ Heterogeneous**: Cloudy, turbid, or with phase separation.
|
| 23 |
+
- **π¦ Solid**: Dispersed solid in liquid or a separate solid phase visible.
|
| 24 |
+
"""
|
| 25 |
# Gradio UI
|
| 26 |
demo = gr.Interface(
|
| 27 |
fn=heinsight.image_demo,
|
|
|
|
| 34 |
gr.JSON(label="Detection Info") # or gr.Textbox() if you prefer plain text
|
| 35 |
],
|
| 36 |
title="HeinSight",
|
| 37 |
+
description=description
|
| 38 |
)
|
| 39 |
|
| 40 |
|
| 41 |
if __name__ == "__main__":
|
| 42 |
+
demo.launch(mcp_server=True)
|