启动后端服务器
cd backend
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
启动前端服务器
cd web
yarn nx serve lq_label
确保有测试数据
cd backend && python init_sample_data.py目标:验证标注可以正确保存,任务状态更新为"已完成"
http://localhost:4200目标:验证已保存的标注结果可以正确加载
目标:验证修改标注后可以正确更新,不会创建重复记录
目标:验证数据库中的数据正确性
backend/annotation_platform.db查询标注表:
SELECT * FROM annotations WHERE task_id = 'your_task_id';
验证点:
result 字段包含完整的标注数据(JSON 格式)updated_at 字段在修改后有更新查询任务表:
SELECT id, name, status FROM tasks WHERE id = 'your_task_id';
验证点:
status 字段为 'completed'Loading LabelStudio editor for task: task_xxx
Initializing LabelStudio instance...
Creating new annotation
LabelStudio instance initialized
Annotation result: { result: [...] }
Sending annotation data: { result: [...] }
Created new annotation
Task marked as completed
Loading LabelStudio editor for task: task_xxx
Existing annotations: [{ id: 'ann_xxx', ... }]
Loaded existing annotation: { id: 'ann_xxx', result: {...} }
Initializing LabelStudio instance...
Loading existing annotation: { result: [...] }
LabelStudio instance initialized
Annotation result: { result: [...] }
Sending annotation data: { result: [...] }
Updated existing annotation: ann_xxx
Task marked as completed
症状:再次打开任务时,编辑器是空白的
排查步骤:
existingAnnotations 数组是否为空可能原因:
症状:保存后任务仍然显示为"待处理"或"进行中"
排查步骤:
/api/tasks/{id} 请求是否成功可能原因:
症状:数据库中同一个任务有多条标注记录
排查步骤:
getTaskAnnotations API 是否正确返回已有标注可能原因:
getTaskAnnotations 返回空数组建议在以下浏览器中测试:
确保修复没有破坏其他功能:
如果测试中发现问题,请记录: