File size: 2,431 Bytes
0abc32b
 
 
 
 
 
 
 
 
8fd2d1a
0abc32b
 
 
 
 
 
 
8fd2d1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31e40d4
8fd2d1a
0abc32b
 
 
 
 
 
 
 
 
 
 
8fd2d1a
31e40d4
 
8fd2d1a
 
 
31e40d4
 
0abc32b
 
 
31e40d4
0abc32b
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: ClusterFlux
emoji: 🧬
colorFrom: blue
colorTo: indigo
sdk: gradio
app_file: app.py
pinned: false
---

# ClusterFlux: YOLO Segmentation Model Server

**ClusterFlux** is an interactive and API-ready Gradio Space for orbital streak image segmentation. It serves a YOLO-based segmentation model, with version tracking and reproducibility features for scientific workflows.

- **Model version** is shown in the UI and included in API responses.
- **Weights** are managed with Git LFS for large file support.
- **Designed for integration** with annotation tools (e.g., CVAT) and downstream astronomical data pipelines.

## Quickstart

1. Install dependencies:

```bash
pip install -r requirements.txt
```

2. Run the server locally:

```bash
python app.py
```

3. Deploy to [Hugging Face Spaces](https://huggingface.co/spaces):
   - Push this directory to a new Space as a Gradio app.
   - If you update dependencies, restart the Space from the web UI to ensure a clean rebuild.

## Usage

- Upload an image to receive a segmentation mask generated by the latest YOLO model.
- The current model version is always visible for traceability.
- For programmatic access, use the Gradio API endpoint; the response includes both the mask and version.

## Deployment Workflow

- Model weights are copied into `weights/best.pt` and versioned via the `VERSION` file.
- `deploy.sh` automates model update and Hugging Face Space deployment, with Git LFS support.

## Integration
- The API will accept an image and return a segmentation mask (as an image) and the model version as a string.
- For annotation tool integration (e.g., CVAT), see the [NOTES.md](../NOTES.md) for design decisions and API tips.

## Notes
- Add any additional dependencies to `requirements.txt` as needed.
- For Spaces, ensure your model weights are included or downloadable (Git LFS required for files >10MB).
- If you change requirements.txt, restart the Space from the Hugging Face UI ("Restart from Scratch") to ensure dependency updates are applied.

## Citation & Context

This tool is part of the Swinburne DECam synthetic data and orbital streak segmentation research project. For scientific use, please cite appropriately and refer to the project thesis and [NOTES.md](../NOTES.md) for detailed methodology and rationale.

---

For more details, see the [Hugging Face Spaces config reference](https://huggingface.co/docs/hub/spaces-config-reference).