From c8dc5f930171fdf8a827612aa7ea8fa5c554c5d2 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Sat, 7 Mar 2026 15:37:16 +0800 Subject: [PATCH] docs: update project documentation and configuration --- .justfile | 13 ------------- CLAUDE.md | 42 ++++++++++++++++++++++++++++++------------ openspec/config.yaml | 36 ++++++++++++++++++++++++------------ 3 files changed, 54 insertions(+), 37 deletions(-) diff --git a/.justfile b/.justfile index 1991978..e69de29 100644 --- a/.justfile +++ b/.justfile @@ -1,13 +0,0 @@ -activate: - micromamba activate ./.venv - -update-venv: - micromamba env export --no-builds | grep -v "prefix" > venv.yaml - -download-test: - python -m habitat_sim.utils.datasets_download --uids habitat_test_scenes --data-path data/ - python -m habitat_sim.utils.datasets_download --uids habitat_test_pointnav_dataset --data-path data/ - python -m habitat_sim.utils.datasets_download --uids replica_cad_dataset --data-path data/ - python -m habitat_sim.utils.datasets_download --uids rearrange_dataset_v2 --data-path data/ - python -m habitat_sim.utils.datasets_download --uids hab_fetch --data-path data/ - python -m habitat_sim.utils.datasets_download --uids ycb --data-path data/ diff --git a/CLAUDE.md b/CLAUDE.md index 8fb027b..431e715 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,11 +13,13 @@ - 先编写测试集,再实现代码 - 实现测试集后,先询问用户意见,用户确认后才能继续 - 如非用户要求,无需编写基准测试代码 -- 英文注释 +- 英文注释,中文文档 +- 完成代码编写后,在文档的框架不变的情况下更新文档,如CLAUDE.md ### 测试编写原则 - 精简、干净、快速 - 核心关键逻辑或算法必须测试 +- 需要加载transformer模型进行验证的测试与无需加载模型的测试分离 - 无需编写测试集的情况 - UI界面相关的代码 - 过于复杂或耗时的逻辑 @@ -32,20 +34,36 @@ 如需修改其他部分,请先询问,在进行修改。 ## 工程说明 -使用UV管理整个工程,pytest用于测试,justfile用于快捷命令。 +使用UV管理整个工程,pytest用于测试,justfile用于快捷命令,jujutsu用于版本管理。 ### 目录说明 -- mini-nav 为源代码目录 - - mini-nav/configs 为配置文件管理目录,使用python + yaml进行统一的配置管理 - - mini-nav/commands 为CLI命令管理目录,用于管理各种命令 - - mini-nav/tests 为pytest测试集目录,用于管理各项测试集 - - mini-nav/benchmarks 为pytest-benchmark基准测试目录,用于管理各项基准测试,包括速度、准确度等内容 - - mini-nav/visualizer 为plotly、dash的简单数据可视化APP - - mini-nav/database.py 用于管理lancedb数据库 - - mini-nav/feature_retrieval.py 用于实现图像特征检索 - - mini-nav/main.py 为主程序入口 -- outputs 为默认输出目录 +**核心模块** +- mini-nav/main.py — CLI 入口 (Typer) +- mini-nav/database.py — LanceDB 单例管理,用于向量存储与检索 +- mini-nav/feature_retrieval.py — DINOv2 图像特征提取与检索 + +**源代码目录 (mini-nav/)** +- mini-nav/configs/ — 配置管理 (Pydantic + YAML) +- mini-nav/commands/ — CLI 命令 (train, benchmark, visualize, generate) +- mini-nav/compressors/ — 特征压缩算法 + - hash_compressor.py — 哈希压缩器 + - dino_compressor.py — DINO 压缩器 + - segament_compressor.py — 分割压缩器 + - pipeline.py — 压缩流水线 + - train.py — 压缩器训练 +- mini-nav/data_loading/ — 数据加载与合成 + - loader.py — 数据加载器 + - synthesizer.py — 场景合成器 +- mini-nav/utils/ — 工具函数 + - feature_extractor.py — 特征提取工具 +- mini-nav/tests/ — pytest 测试集 +- mini-nav/benchmarks/ — 基准测试 (recall@k) +- mini-nav/visualizer/ — Dash + Plotly 可视化应用 + +**数据目录** +- datasets/ — 数据集目录 +- outputs/ — 默认输出目录 (数据库、模型权重等) ### Python库 详细可查询pyproject.toml或使用`uv pip list`获取详细的库信息,请基于目前的库实现功能。 diff --git a/openspec/config.yaml b/openspec/config.yaml index 392946c..5d898a8 100644 --- a/openspec/config.yaml +++ b/openspec/config.yaml @@ -3,18 +3,30 @@ schema: spec-driven # Project context (optional) # This is shown to AI when creating artifacts. # Add your tech stack, conventions, style guides, domain knowledge, etc. -# Example: -# context: | -# Tech stack: TypeScript, React, Node.js -# We use conventional commits -# Domain: e-commerce platform +context: | + Tech stack: Python 3.10+, PyTorch, DINOv2, SAM 2.1, LanceDB, Typer, Dash, Plotly + Dependencies: transformers, torch, torchvision, lancedb, polars, dash, typer, pydantic + Build tools: UV (package manager), pytest (testing), justfile (tasks), jujutsu (Version Control) + + Conventions: + - Google Python Style Guide + - TDD: Write tests before implementation + - Single-layer nesting max in conditionals/loops + - English comments only + + Domain: Vision-language navigation and image feature retrieval + - Feature extraction using DINOv2 (facebook/dinov2-large) + - Image segmentation using SAM 2.1 (facebook/sam2.1-hiera-large) + - Vector storage and retrieval with LanceDB + - Feature compression for efficient storage # Per-artifact rules (optional) # Add custom rules for specific artifacts. -# Example: -# rules: -# proposal: -# - Keep proposals under 500 words -# - Always include a "Non-goals" section -# tasks: -# - Break tasks into chunks of max 2 hours +rules: + proposal: + - Keep proposals under 500 words + - Always include a "Non-goals" section + - Focus on incremental changes + tasks: + - Break tasks into chunks of max 2 hours + - Write tests before implementation code