重组为 backend/clients/docs 三层结构,并清理 git 污染。
将后端迁入 backend/,完善根目录 .gitignore,删除误提交的 .mypy_cache 缓存文件。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
88
.gitignore
vendored
88
.gitignore
vendored
@@ -1,37 +1,77 @@
|
||||
# Python-generated files
|
||||
__pycache__/
|
||||
*.py[oc]
|
||||
build/
|
||||
dist/
|
||||
wheels/
|
||||
*.egg-info
|
||||
# =============================================================================
|
||||
# Operation Room Monitor — root .gitignore
|
||||
# =============================================================================
|
||||
|
||||
# Virtual environments
|
||||
.venv
|
||||
# --- OS ---
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
|
||||
# --- IDE / editors ---
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.project
|
||||
.classpath
|
||||
.settings/
|
||||
|
||||
# Runtime consumption TSV (开发联调)
|
||||
logs/
|
||||
|
||||
# Environment
|
||||
# --- Environment & secrets (all layers) ---
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
!**/.env.example
|
||||
backend/.env
|
||||
backend/.env.*
|
||||
!backend/.env.example
|
||||
|
||||
# Demo 一键联调写入的 RTSP 映射(可被覆盖)
|
||||
# --- Python caches (never commit) ---
|
||||
.mypy_cache/
|
||||
**/.mypy_cache/
|
||||
**/__pycache__/
|
||||
**/*.py[cod]
|
||||
**/*$py.class
|
||||
**/.pytest_cache/
|
||||
**/.mypy_cache/
|
||||
**/.ruff_cache/
|
||||
**/.pycache-verify/
|
||||
**/build/
|
||||
**/wheels/
|
||||
**/*.egg-info/
|
||||
**/.coverage
|
||||
**/htmlcov/
|
||||
**/.tox/
|
||||
**/.nox/
|
||||
**/dist/
|
||||
!clients/voice-confirmation/scripts/
|
||||
|
||||
# Backend runtime & caches
|
||||
backend/logs/
|
||||
backend/Ultralytics/
|
||||
|
||||
# Large model weights (deploy via mount or offline delivery)
|
||||
backend/app/resources/actionformer_epoch_045.pth.tar
|
||||
|
||||
# --- Clients ---
|
||||
clients/demo-client/.runtime/
|
||||
clients/demo-client/labels.json
|
||||
clients/voice-confirmation/dist/
|
||||
|
||||
# IDE / OS
|
||||
.idea/
|
||||
.vscode/
|
||||
.DS_Store
|
||||
# --- Docker ---
|
||||
**/.docker/
|
||||
|
||||
# Ultralytics / YOLO: local cache and user settings (keep on machine only)
|
||||
# --- Logs & temp ---
|
||||
*.log
|
||||
*.tmp
|
||||
*.temp
|
||||
.cache/
|
||||
|
||||
# --- Legacy / local-only at repo root (pre-restructure) ---
|
||||
.venv/
|
||||
logs/
|
||||
Ultralytics/
|
||||
|
||||
#
|
||||
|
||||
# 5-6 ActionFormer checkpoint:>100MB,部署时挂载或离线下发,不入库
|
||||
app/resources/actionformer_epoch_045.pth.tar
|
||||
scripts/
|
||||
|
||||
41
README.md
41
README.md
@@ -0,0 +1,41 @@
|
||||
# Operation Room Monitor
|
||||
|
||||
手术室耗材监控:后端 API(GPU 推理)+ 独立浏览器客户端。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
.
|
||||
├── backend/ # FastAPI + PostgreSQL + MinIO
|
||||
│ ├── app/ # 业务与算法
|
||||
│ ├── docker-compose.yml
|
||||
│ ├── Dockerfile
|
||||
│ ├── .env.example
|
||||
│ └── ...
|
||||
├── clients/ # 独立前端(手动部署)
|
||||
│ ├── demo-client/ # 联调 Demo 页 (:38081)
|
||||
│ └── voice-confirmation/ # 语音确认页 (:8080)
|
||||
└── docs/ # 部署与接口文档
|
||||
```
|
||||
|
||||
## 快速开始
|
||||
|
||||
```bash
|
||||
# 1. 配置并启动后端(在 backend/ 目录)
|
||||
cp backend/.env.example backend/.env # 编辑配置
|
||||
cd backend && docker compose up -d --build
|
||||
|
||||
# 2. 启动客户端(各开终端)
|
||||
cd clients/demo-client && ./start.sh
|
||||
cd clients/voice-confirmation && ./start.sh
|
||||
```
|
||||
|
||||
- API:`http://<服务器IP>:38080`
|
||||
- Demo:`http://<服务器IP>:38081`
|
||||
- 语音确认:`http://<服务器IP>:8080`
|
||||
|
||||
## 文档
|
||||
|
||||
- [Docker 部署](docs/Docker部署.md)
|
||||
- [客户端接口说明](docs/客户端手术通信接口说明.md)
|
||||
- [语音确认页使用指南](docs/部署版使用指南.md)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 复制为 `.env` 并按环境填写。后端通过 Docker Compose 部署:`docker compose up -d --build`
|
||||
# 复制为 `backend/.env` 并按环境填写。在 `backend/` 目录执行:`docker compose up -d --build`
|
||||
# 详细说明见 docs/Docker部署.md 与 docs/video-backends.md。
|
||||
# 算法、管线、归档路径、视觉/语音日志等非部署项见 `app/baked/algorithm.py` 与 `app/baked/pipeline.py`。
|
||||
#
|
||||
@@ -193,7 +193,7 @@ class Settings(BaseSettings):
|
||||
default="vision",
|
||||
validation_alias=AliasChoices("VIDEO_RESULT_DOCTOR_ID", "video_result_doctor_id"),
|
||||
)
|
||||
#: 算法引用包目录(相对仓库根,如 ``refs/5.15``);可用环境变量 ``REFERENCE_BUNDLE_RELATIVE`` 覆盖。
|
||||
#: 算法引用包目录(相对 backend 根目录,如 ``refs/5.15``);可用环境变量 ``REFERENCE_BUNDLE_RELATIVE`` 覆盖。
|
||||
reference_bundle_relative: str = Field(
|
||||
default="refs/5.15",
|
||||
validation_alias=AliasChoices("REFERENCE_BUNDLE_RELATIVE", "reference_bundle_relative"),
|
||||
@@ -1,6 +1,6 @@
|
||||
# Unified backend stack: FastAPI + PostgreSQL + MinIO (GPU via NVIDIA Container Toolkit).
|
||||
# Deploy: docker compose up -d --build
|
||||
# Client pages: clients/demo-client/start.sh, clients/voice-confirmation/start.sh
|
||||
# Deploy from this directory: docker compose up -d --build
|
||||
# Client pages (repo root): ../clients/demo-client/start.sh, ../clients/voice-confirmation/start.sh
|
||||
services:
|
||||
db:
|
||||
image: m.daocloud.io/docker.io/library/postgres:16-alpine
|
||||
|
Before Width: | Height: | Size: 451 KiB After Width: | Height: | Size: 451 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user