调整项目库拆帧与长帧序列加载

- 删除项目库右上角独立新建项目入口,保留导入视频/DICOM 自动建项目流程

- 视频项目支持已生成帧后的重新生成帧入口,并提示会清空旧帧、标注和 mask

- 后端重新拆帧任务开始前清理旧帧、旧标注和旧 mask,避免重复帧序列

- 项目帧列表接口默认返回完整帧序列,避免工作区总帧数被 1000 条默认 limit 截断

- 增加可选 docker-compose.gpu.yml,并补充 Docker 使用本机 GPU 的前提和启动说明

- 更新项目库、API 映射、恢复演示文案、后端媒体/项目测试和前端文档
This commit is contained in:
2026-05-07 16:38:13 +08:00
parent 620e95ff91
commit 2a2e6b9b6c
19 changed files with 196 additions and 126 deletions

View File

@@ -50,6 +50,29 @@ def test_project_crud_and_frames(client, monkeypatch):
assert client.get(f"/api/projects/{project_id}").status_code == 404
def test_list_project_frames_returns_more_than_default_timeline_window(client, db_session, monkeypatch):
monkeypatch.setattr("routers.projects.get_presigned_url", lambda key, expires=3600: f"http://storage/{key}")
created = client.post("/api/projects", json={"name": "Long Sequence", "status": "ready"})
assert created.status_code == 201
project_id = created.json()["id"]
db_session.add_all([
Frame(project_id=project_id, frame_index=index, image_url=f"frames/{index}.jpg")
for index in range(1001)
])
db_session.commit()
frames = client.get(f"/api/projects/{project_id}/frames")
assert frames.status_code == 200
body = frames.json()
assert len(body) == 1001
assert body[-1]["frame_index"] == 1000
limited = client.get(f"/api/projects/{project_id}/frames?limit=2")
assert limited.status_code == 200
assert [frame["frame_index"] for frame in limited.json()] == [0, 1]
def test_delete_project_cascades_related_records(client, db_session):
created = client.post("/api/projects", json={"name": "Cascade Delete"})
assert created.status_code == 201