80 lines
2.6 KiB
Markdown
80 lines
2.6 KiB
Markdown
# Seg Data Server Net
|
|
|
|
Modular web control plane for the existing Seg image segmentation workspace.
|
|
|
|
The platform keeps the current training and analysis scripts as the compute
|
|
core, then adds:
|
|
|
|
- a FastAPI backend for catalog discovery, job orchestration, logs, results,
|
|
GPU status, and weight management;
|
|
- a React/Vite frontend for launching jobs and inspecting progress;
|
|
- a unified `weights/` area with a generated manifest for `.pt`, `.pth`,
|
|
`.onnx`, and `.engine` assets.
|
|
|
|
## Layout
|
|
|
|
```text
|
|
Seg_Data_Server_Net/
|
|
backend/ FastAPI API, job runner, module wrappers
|
|
frontend/ React + Vite operator UI
|
|
scripts/ helper scripts for running services and syncing weights
|
|
weights/ copied model weights and manifest.json
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
cd Seg_Data_Server_Net
|
|
cp .env.example .env
|
|
|
|
# Backend. The existing machine already has a seg_server env with FastAPI.
|
|
conda run -n seg_server uvicorn app.main:app --app-dir backend --host 0.0.0.0 --port 8000
|
|
|
|
# Frontend.
|
|
cd frontend
|
|
npm install
|
|
npm run dev -- --host 0.0.0.0
|
|
```
|
|
|
|
Open the Vite URL shown in the terminal. The frontend expects the backend at
|
|
`http://localhost:8000` by default.
|
|
|
|
## Weight Sync
|
|
|
|
The current workspace contains tens of GB of pretrained and trained weights.
|
|
They are copied into `weights/files/<original-relative-path>` and indexed in
|
|
`weights/manifest.json`.
|
|
|
|
```bash
|
|
cd Seg_Data_Server_Net
|
|
python scripts/sync_weights.py --mode copy --hash
|
|
```
|
|
|
|
For repository storage, use Git LFS or a Gitea release/package store:
|
|
|
|
```bash
|
|
git lfs install
|
|
git lfs track "*.pt" "*.pth" "*.onnx" "*.engine"
|
|
```
|
|
|
|
If Git LFS is not available on the host or server, keep the copied weights on
|
|
the deployment volume and commit only `weights/manifest.json`.
|
|
|
|
## Job Types
|
|
|
|
The backend exposes all current Seg capabilities as job types. Examples:
|
|
|
|
- `dataset.rename`, `dataset.resize`, `dataset.pair`, `dataset.rebuild_labels`,
|
|
`dataset.stack`, `dataset.stitch`, `dataset.video_frames`
|
|
- `segmodel.train`, `segmodel.batch_train`, `segmodel.predict`,
|
|
`segmodel.batch_predict`, `segmodel.flops`, `segmodel.raw_mask_check`
|
|
- `yolo.train`, `yolo.batch_train`, `yolo.predict`, `yolo.batch_predict`,
|
|
`yolo.heatmap`, `yolo.compare`, `yolo.raw_mask_check`, `yolo.video_visible`
|
|
- `mmseg.generate_data`, `mmseg.generate_alg`, `mmseg.train`,
|
|
`mmseg.metrics`, `mmseg.flops_fps`, `mmseg.draw`, `mmseg.extract_loss_miou`
|
|
- `analysis.all`, `system.backup`, `mock.echo`
|
|
|
|
Use `GET /api/catalog` to inspect supported models, algorithms, datasets, and
|
|
task types discovered from the existing `Seg/` workspace.
|
|
|