qqyule commited on
Commit
6f8d8d9
·
0 Parent(s):

feat: initialize project structure for Objectverse Diary

Browse files

- Add .env.example for environment variables configuration.
- Create .gitignore to exclude sensitive files and directories.
- Introduce AGENTS.md for project overview and goals.
- Establish README.md with project description and current status.
- Set up data directories with README files for examples, training, evaluation, and traces.
- Document project overview, PRD, tech architecture, dev schedule, hackathon guide, dev guidelines, and submission guide in respective markdown files.
- Create a template for README and field notes.
- Add model card for future model documentation.
- Initialize scripts directory for planned automation scripts.
- Set up source directory with planned areas for application code.
- Add README files in each source subdirectory to outline planned components and current status.
- Create pyproject.toml and requirements.txt for project dependencies.

.codex/project.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary
2
+
3
+ ## Context
4
+
5
+ Objectverse Diary is a Build Small Hackathon project for the "An Adventure in Thousand Token Wood" track.
6
+
7
+ Core idea: upload an everyday object photo, identify the object, generate a hidden persona, write a first-person secret diary, support follow-up chat, and create a shareable personality card.
8
+
9
+ ## Non-Negotiable Constraints
10
+
11
+ - Total model parameters <= 32B.
12
+ - Gradio is required.
13
+ - Final app must be hosted on Hugging Face Space.
14
+ - No commercial cloud model APIs.
15
+ - UI is English-first and Chinese-second.
16
+ - Do not expose credit codes, tokens, credentials, or private paths.
17
+
18
+ ## MVP Priority
19
+
20
+ 1. Image upload.
21
+ 2. Object recognition JSON.
22
+ 3. Persona generation JSON.
23
+ 4. Secret diary output.
24
+ 5. Object chat.
25
+ 6. Share card.
26
+ 7. Trace logger.
27
+ 8. Gradio UI polish.
28
+ 9. README and demo materials.
29
+
30
+ ## Current Status
31
+
32
+ Structure-only initialization. No application implementation code has been added yet.
.codex/skills/dataset-trace/SKILL.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dataset And Trace Skill
2
+
3
+ Use this when creating training data, sample outputs, traces, or public reproducibility materials.
4
+
5
+ ## Dataset Rules
6
+
7
+ - Use synthetic or authorized examples only.
8
+ - Do not include personal sensitive data.
9
+ - Keep raw images separate from public traces.
10
+ - Target 200-500 training samples.
11
+ - Manually select at least 50 high-quality examples.
12
+
13
+ ## Trace Rules
14
+
15
+ - Public traces must be anonymized.
16
+ - Trace JSON should show model decisions clearly enough for judges and builders to understand the pipeline.
17
+ - Target at least 6 public traces for example objects.
18
+
19
+ ## Expected Trace Contents
20
+
21
+ - object input metadata
22
+ - personality mode
23
+ - object understanding JSON
24
+ - persona JSON
25
+ - diary output
26
+ - model/runtime metadata
27
+ - fallback markers, if any
28
+
29
+ ## Current Status
30
+
31
+ No datasets or traces have been generated yet.
.codex/skills/gradio-ui/SKILL.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gradio UI Skill
2
+
3
+ Use this when implementing or reviewing the Objectverse Diary Gradio interface.
4
+
5
+ ## Product Direction
6
+
7
+ The UI should feel like a strange archive room for everyday objects, not a default Gradio demo.
8
+
9
+ Recommended mood:
10
+
11
+ - dark paper texture
12
+ - amber highlights
13
+ - typewriter diary output
14
+ - museum labels
15
+ - mysterious but polished object archive
16
+
17
+ ## Layout
18
+
19
+ Recommended structure:
20
+
21
+ 1. Object Intake
22
+ 2. Object File
23
+ 3. Secret Diary
24
+ 4. Chat With Object
25
+ 5. Share Card
26
+ 6. Trace Export
27
+
28
+ ## Requirements
29
+
30
+ - Use `gr.Blocks` as the main app structure.
31
+ - English-first, Chinese-second.
32
+ - Main components should have `elem_id` or `elem_classes`.
33
+ - Custom CSS belongs in `src/ui/styles.css`.
34
+ - UI copy belongs in `src/ui/copy.py`.
35
+ - Must work at 1366px desktop width and mobile width.
36
+
37
+ ## Current Status
38
+
39
+ No UI implementation yet.
.codex/skills/hf-space/SKILL.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Space Skill
2
+
3
+ Use this when preparing the Hugging Face Space deployment.
4
+
5
+ ## Requirements
6
+
7
+ - SDK must be Gradio.
8
+ - `app_file` should point to `app.py` once implementation starts.
9
+ - README should document model choices, parameter counts, fallback strategy, and badge evidence.
10
+ - Do not expose secrets, private paths, credit codes, or tokens.
11
+
12
+ ## Planned README Header
13
+
14
+ ```yaml
15
+ ---
16
+ title: Objectverse Diary
17
+ emoji: 🗝️
18
+ colorFrom: amber
19
+ colorTo: gray
20
+ sdk: gradio
21
+ app_file: app.py
22
+ pinned: false
23
+ ---
24
+ ```
25
+
26
+ ## Deployment Checks
27
+
28
+ - App launches locally.
29
+ - App launches on HF Space.
30
+ - Demo examples work without private assets.
31
+ - README links are valid.
32
+ - No commercial model APIs are required.
33
+
34
+ ## Current Status
35
+
36
+ Deployment has not started.
.codex/skills/model-runtime/SKILL.md ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model Runtime Skill
2
+
3
+ Use this when implementing or reviewing model runtime code.
4
+
5
+ ## Planned Layers
6
+
7
+ - Vision Runner: object recognition and visible feature extraction.
8
+ - Text Runner: persona, diary, and chat generation through llama.cpp / llama-cpp-python.
9
+ - Schema: structured validation for object, persona, diary, and trace outputs.
10
+
11
+ ## Requirements
12
+
13
+ - No commercial cloud AI APIs.
14
+ - Text generation should support a local llama.cpp path.
15
+ - Output must be structured JSON before rendering.
16
+ - Invalid JSON should trigger repair or fallback behavior.
17
+ - Total model parameters must remain <= 32B.
18
+ - Model parameter counts must be documented in README and model card.
19
+
20
+ ## Fallback Strategy
21
+
22
+ - VLM failure: manual object description or example gallery path.
23
+ - Text model failure: safe template fallback.
24
+ - JSON failure: repair, validate, and expose trace information.
25
+
26
+ ## Current Status
27
+
28
+ No runtime implementation yet.
.codex/skills/submission/SKILL.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Submission Skill
2
+
3
+ Use this when preparing final hackathon submission materials.
4
+
5
+ ## Required Links
6
+
7
+ - Hugging Face Space URL
8
+ - GitHub Repository URL
9
+ - Demo Video URL
10
+ - Social Media Post URL
11
+ - Fine-tuned Model URL
12
+ - Dataset URL
13
+ - Trace Dataset URL
14
+ - Field Notes Blog URL
15
+ - Short project description
16
+
17
+ ## Demo Video Flow
18
+
19
+ Recommended length: under 2 minutes.
20
+
21
+ 1. Hook: every object has a secret life.
22
+ 2. Upload and personality mode selection.
23
+ 3. Model recognition and persona generation.
24
+ 4. Secret diary and chat.
25
+ 5. Share card.
26
+ 6. Badge checklist and technical stack.
27
+
28
+ ## Final Checklist
29
+
30
+ - Space under official organization.
31
+ - README complete.
32
+ - Model parameter counts documented.
33
+ - No commercial cloud AI APIs.
34
+ - Fine-tuned model linked.
35
+ - Dataset linked.
36
+ - Traces linked.
37
+ - Field Notes linked.
38
+ - UI English-first, Chinese-second.
39
+ - Submitted before June 15, 2026.
40
+
41
+ ## Current Status
42
+
43
+ Submission materials have not started.
.env.example ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Copy this file to .env only when implementation starts.
2
+ # Never commit real credentials, credit codes, tokens, or private paths.
3
+
4
+ HF_SPACE_ID=
5
+ HF_MODEL_REPO=
6
+ HF_DATASET_REPO=
7
+ TEXT_MODEL_PATH=
8
+ VISION_MODEL_ID=
9
+ TRACE_OUTPUT_DIR=data/traces
.gitignore ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+
8
+ # Virtual environments
9
+ .venv/
10
+ venv/
11
+
12
+ # Environment and secrets
13
+ .env
14
+ .env.*
15
+ !.env.example
16
+
17
+ # Model and generated artifacts
18
+ models/
19
+ *.gguf
20
+ *.safetensors
21
+ *.ckpt
22
+ *.pt
23
+ *.pth
24
+
25
+ # Generated traces and exports
26
+ data/traces/*.json
27
+ data/traces/*.jsonl
28
+ exports/
29
+
30
+ # System files
31
+ .DS_Store
AGENTS.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AGENTS.md
2
+
3
+ ## Project
4
+
5
+ Objectverse Diary is a Build Small Hackathon project.
6
+ It is an English-first, Chinese-second Gradio application where users upload everyday object photos and small AI models generate secret object personas, diary entries, conversations, and shareable cards.
7
+
8
+ ## Primary Goals
9
+
10
+ 1. Compete in the "An Adventure in Thousand Token Wood" track.
11
+ 2. Keep total model parameters <= 32B.
12
+ 3. Use Gradio for all UI and interaction.
13
+ 4. Host the final app as a Hugging Face Space.
14
+ 5. Avoid commercial cloud AI APIs.
15
+ 6. Maximize hackathon badges.
16
+ 7. Use English as the main UI language and Chinese as secondary helper text.
17
+
18
+ ## Non-Negotiable Rules
19
+
20
+ - Do not use OpenAI, Anthropic, Gemini, Cohere, or other commercial model APIs.
21
+ - Do not leak private credit codes, tokens, emails, or credentials.
22
+ - Do not hardcode secrets.
23
+ - Do not remove Gradio.
24
+ - Do not make the UI Chinese-first.
25
+ - Do not exceed the 32B total model parameter limit.
26
+ - Do not add large features that risk missing the submission deadline.
27
+ - Do not store unconsented personal user data.
28
+
29
+ ## Tech Stack
30
+
31
+ - Python
32
+ - Gradio Blocks
33
+ - Hugging Face Spaces
34
+ - llama.cpp / llama-cpp-python for text generation
35
+ - MiniCPM-V or fallback lightweight VLM for object understanding
36
+ - LoRA / PEFT for fine-tuning
37
+ - Markdown documentation
38
+
39
+ ## UI Requirements
40
+
41
+ The interface must be English-first and Chinese-second.
42
+ Visual style: strange object archive, not default Gradio demo.
43
+ Recommended UI mood: mysterious archive, typewriter diary, warm dark paper, amber highlight, museum label, strange but polished.
44
+
45
+ ## Architecture
46
+
47
+ 1. Image upload
48
+ 2. Object understanding
49
+ 3. Persona generation
50
+ 4. Secret diary generation
51
+ 5. Object chat
52
+ 6. Share card rendering
53
+ 7. Trace export
54
+
55
+ ## Coding Guidelines
56
+
57
+ - Use type hints.
58
+ - Prefer small, composable functions.
59
+ - Prompts belong under `src/prompts/`.
60
+ - UI copy belongs under `src/ui/copy.py`.
61
+ - CSS belongs under `src/ui/styles.css`.
62
+ - Runtime code belongs under `src/models/`.
63
+ - Trace code belongs under `src/traces/`.
64
+ - Use Pydantic schemas for model outputs.
65
+ - Add clear fallback behavior when model output is invalid.
66
+
67
+ ## Testing Requirements
68
+
69
+ - App runs locally.
70
+ - App runs on HF Space.
71
+ - At least 6 sample objects work.
72
+ - Share card renders correctly.
73
+ - Trace export works.
74
+ - No secret keys committed.
75
+ - README links valid.
76
+ - Demo video flow reproducible.
77
+
78
+ ## Current Initialization Boundary
79
+
80
+ The current phase is structure-only. Do not add application implementation code until the implementation phase starts.
README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary
2
+
3
+ **Every object has a secret life.**
4
+ **万物日记:每个物品都有秘密人生。**
5
+
6
+ Objectverse Diary is a small-model AI toy built for the Build Small Hackathon.
7
+
8
+ Upload a photo of any everyday object. The app wakes it up, gives it a secret personality, writes its diary, and lets you chat with it.
9
+
10
+ ## Current Status
11
+
12
+ Project structure only. No application implementation code has been added yet.
13
+
14
+ ## Track
15
+
16
+ An Adventure in Thousand Token Wood
17
+
18
+ ## Why This Fits the Track
19
+
20
+ This is a pure digital experience that could not exist without AI:
21
+
22
+ - vision understanding
23
+ - object persona generation
24
+ - first-person diary writing
25
+ - consistent character chat
26
+ - shareable personality cards
27
+
28
+ ## Language
29
+
30
+ The interface is English-first and Chinese-second.
31
+
32
+ ## Badge Targets
33
+
34
+ - [ ] Off the Grid
35
+ - [ ] Well-Tuned
36
+ - [ ] Off-Brand
37
+ - [ ] Llama Champion
38
+ - [ ] Sharing is Caring
39
+ - [ ] Field Notes
40
+ - [ ] OpenBMB Special
41
+
42
+ ## Planned Model Stack
43
+
44
+ - Vision: MiniCPM-V or lightweight VLM fallback
45
+ - Text: fine-tuned small LLM
46
+ - Runtime: llama.cpp / llama-cpp-python
47
+ - UI: Gradio Blocks
48
+
49
+ ## Run Locally
50
+
51
+ Not available yet. `app.py` and runtime code will be added during the implementation phase.
52
+
53
+ ## Project Structure
54
+
55
+ See `docs/02-tech-architecture.md`, `AGENTS.md`, and `.codex/skills/` for the intended structure and development rules.
56
+
57
+ ## HF Space README YAML Header
58
+
59
+ ```yaml
60
+ ---
61
+ title: Objectverse Diary
62
+ emoji: 🗝️
63
+ colorFrom: amber
64
+ colorTo: gray
65
+ sdk: gradio
66
+ app_file: app.py
67
+ pinned: false
68
+ ---
69
+ ```
data/README.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Data
2
+
3
+ This directory is reserved for examples, training data, evaluation samples, and anonymized traces.
4
+
5
+ ## Privacy Rule
6
+
7
+ Do not store personal or sensitive data here. Public traces must be anonymized.
data/eval/README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Evaluation Data
2
+
3
+ Reserved for evaluation examples and acceptance checks.
4
+
5
+ Examples should cover cups, keyboards, shoes, and other everyday objects.
data/examples/README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Examples
2
+
3
+ Reserved for public example objects and sample outputs.
4
+
5
+ Target: at least 6 example objects for the demo gallery.
data/traces/README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Traces
2
+
3
+ Reserved for anonymized public traces.
4
+
5
+ Target: at least 6 public traces for the Sharing is Caring badge.
data/train/README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Training Data
2
+
3
+ Reserved for SFT or LoRA training data.
4
+
5
+ Target: 200-500 generated samples, with at least 50 manually selected high-quality samples.
docs/00-project-overview.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — 项目概述
2
+
3
+ > **Every object has a secret life.**
4
+ > 万物日记:让身边物品开口讲出它的隐藏人格
5
+
6
+ ## 项目定位
7
+
8
+ Objectverse Diary 是一个基于小模型的互动式 AI 数字玩具,参加 **Build Small Hackathon** 的 **赛道 2:An Adventure in Thousand Token Wood**。
9
+
10
+ 用户上传任意日常物品照片,AI 识别物品后,为它生成一个"隐藏人格",再以第一人称写出一篇荒诞、幽默、带一点毒舌的 Secret Diary。用户可以继续追问这个物品,最后生成一张可分享的英文主视觉卡片,中文作为辅助翻译。
11
+
12
+ ## 一句话描述
13
+
14
+ ```text
15
+ Objectverse Diary is a small-model AI toy that turns everyday objects into living characters
16
+ with secret diaries, weird memories, and shareable personality cards.
17
+ ```
18
+
19
+ 中文辅助:
20
+
21
+ ```text
22
+ Objectverse Diary 是一个小模型 AI 玩具:上传一个日常物品,它会拥有隐藏人格、秘密日记和可分享的人格卡片。
23
+ ```
24
+
25
+ ## 赛道匹配度
26
+
27
+ | 官方评审点 | 对应设计 |
28
+ | ----------------- | ---------------------------------------------------------------------- |
29
+ | 强吸引力 / 自传播 | 用户上传自己的杯子、键盘、鞋子、冰箱贴,得到荒诞人格卡,很容易截图分享 |
30
+ | AI 是核心支撑 | 没有视觉识别 + 角色生成 + 多轮人格一致性,就无法成立 |
31
+ | 原创性 | 不是普通聊天,不是普通图像描述,而是"物品人格宇宙" |
32
+ | Gradio 完成度 | 可以把 Gradio 魔改成复古档案馆 / 神秘博物馆 / 打字机日记界面 |
33
+ | 小模型契合 | 任务是识图、短文生成、人格一致性、结构化输出,小模型足够 |
34
+ | 视频演示强 | 30 秒内就能让评委理解并产生记忆点 |
35
+
36
+ ## 核心体验流程
37
+
38
+ ```text
39
+ 上传物品 → 选择人格模式 → AI 识别 → 生成物品人格 → 输出秘密日记 → 对话追问 → 生成分享卡片
40
+ ```
41
+
42
+ 详细步骤:
43
+
44
+ 1. User uploads an object photo
45
+ 2. User selects a personality mode
46
+ 3. VLM identifies the object
47
+ 4. Small LLM creates a structured object persona
48
+ 5. App renders a secret diary
49
+ 6. User asks follow-up questions
50
+ 7. App generates a shareable card
51
+ 8. Trace is saved anonymously
52
+
53
+ ## UI 语言规范
54
+
55
+ **English-first, Chinese-second.**
56
+
57
+ | 页面元素 | 英文主文案 | 中文辅助 |
58
+ | -------- | ------------------------- | ---------------- |
59
+ | Title | Objectverse Diary | 万物日记 |
60
+ | Upload | Upload an object photo | 上传一个物品照片 |
61
+ | Mode | Choose a personality mode | 选择人格模式 |
62
+ | Generate | Wake the object | 唤醒这个物品 |
63
+ | Output | Secret Diary | 秘密日记 |
64
+ | Share | Create share card | 生成分享卡片 |
65
+ | Trace | View model trace | 查看模型轨迹 |
66
+
67
+ ## 硬性约束
68
+
69
+ - 模型总参数量 ≤ 32B
70
+ - 必须基于 Gradio
71
+ - 托管在 Hugging Face Space
72
+ - 提交 Demo 视频和社交媒体文案
73
+ - 截止时间:**June 15, 2026**
docs/01-prd.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — PRD(产品需求文档)
2
+
3
+ ## 目标用户
4
+
5
+ ### Primary Users
6
+
7
+ | 用户 | 需求 |
8
+ | -------------------- | ---------------------------------------- |
9
+ | Hackathon judges | 快速理解创意,看到 AI 必要性和技术完整度 |
10
+ | AI builders | 体验小模型也能做出有趣产品 |
11
+ | Social media users | 上传自己的物品,生成可截图分享的结果 |
12
+ | Designers / creators | 获得有趣的角色设定、物品拟人灵感 |
13
+
14
+ ### Secondary Users
15
+
16
+ | 用户 | 需求 |
17
+ | ------------------- | ------------------------------ |
18
+ | 中文用户 | 通过中文辅助说明快速理解玩法 |
19
+ | 设计师 / 文案创作者 | 用它做脑洞练习 |
20
+ | 教育 / 亲子场景 | 把物品拟人化,变成故事创作工具 |
21
+
22
+ ## 核心用户故事
23
+
24
+ ```text
25
+ As a curious user,
26
+ I want to upload a photo of an everyday object,
27
+ so that I can discover its secret personality and diary.
28
+ ```
29
+
30
+ ```text
31
+ As a judge,
32
+ I want to understand within 30 seconds why AI is essential,
33
+ so that I can evaluate originality and technical quality quickly.
34
+ ```
35
+
36
+ ```text
37
+ As a builder,
38
+ I want to see transparent traces and model decisions,
39
+ so that I can learn from and reproduce the project.
40
+ ```
41
+
42
+ ---
43
+
44
+ ## MVP 功能
45
+
46
+ ### P0:必须完成
47
+
48
+ | 功能 | 描述 | 验收标准 |
49
+ | ------------------ | ------------------------ | ----------------------------------------- |
50
+ | Image Upload | 用户上传物品图片 | 支持 JPG / PNG |
51
+ | Object Recognition | 识别物品名称、材质、状态 | 输出结构化 JSON |
52
+ | Persona Generation | 生成物品人格 | 至少包含 name、mood、backstory、complaint |
53
+ | Secret Diary | 生成第一人称日记 | 英文主输出,中文辅助翻译 |
54
+ | Chat with Object | 用户可追问物品 | 角色保持一致 |
55
+ | Share Card | 生成可截图结果卡片 | 包含标题、物品人格、3 个标签 |
56
+ | Trace Logger | 保存示例运行轨迹 | JSON 格式,可公开 |
57
+ | Gradio UI | 完成可用界面 | 不像默认 Gradio |
58
+ | README | 完整说明 | 包含模型、部署、徽章说明 |
59
+ | Demo Video | 2 分钟内视频 | 讲清玩法 + 技术 + 勋章 |
60
+
61
+ ### P1:强加分
62
+
63
+ | 功能 | 描述 |
64
+ | ----------------------- | ---------------------------------------------------- |
65
+ | Personality Modes | Cynical / Dramatic / Lonely / Philosopher / Romantic |
66
+ | Bilingual Toggle | English first / Chinese subtitle |
67
+ | Advanced Model Panel | temperature、top_p、seed |
68
+ | Example Gallery | 预置 6 个示例物品 |
69
+ | Export Trace | 一键保存 trace |
70
+ | Dataset Preview | 展示部分训练样本 |
71
+ | Local Mode Instructions | 本地 llama.cpp 运行说明 |
72
+
73
+ ### P2:时间充足再做
74
+
75
+ | 功能 | 描述 |
76
+ | ------------------- | ---------------- |
77
+ | Voice Reading | 朗读日记 |
78
+ | Multi-object Drama | 多个物品互相吐槽 |
79
+ | Poster Export PNG | 下载结果卡片 |
80
+ | Leaderboard | 最奇怪物品排行榜 |
81
+ | Daily Object Prompt | 今日物品挑战 |
82
+
83
+ ---
84
+
85
+ ## 输出内容设计
86
+
87
+ ### 识别结果 JSON
88
+
89
+ ```json
90
+ {
91
+ "object": {
92
+ "name": "coffee mug",
93
+ "visible_features": ["white ceramic", "small crack", "coffee stain"],
94
+ "likely_context": "developer desk",
95
+ "confidence": 0.86
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### 人格设定 JSON
101
+
102
+ ```json
103
+ {
104
+ "persona": {
105
+ "object_name": "coffee mug",
106
+ "character_name": "Mugworth the Overcaffeinated",
107
+ "mood": "tired but sarcastic",
108
+ "secret_fear": "being replaced by a stainless steel tumbler",
109
+ "core_memory": "witnessed 47 unfinished side projects",
110
+ "complaint": "I am not a personality substitute. I am ceramic.",
111
+ "tags": ["burnt optimism", "desk survivor", "caffeine witness"]
112
+ }
113
+ }
114
+ ```
115
+
116
+ ### 日记输出示例
117
+
118
+ ```text
119
+ Secret Diary — Day 417
120
+
121
+ He filled me again before sunrise. No apology. No eye contact.
122
+ Just another bitter liquid and the soft panic of a person
123
+ pretending deadlines are a lifestyle...
124
+ ```
125
+
126
+ 中文辅助:
127
+
128
+ ```text
129
+ 秘密日记 — 第 417 天
130
+
131
+ 天还没亮,他又把我倒满了。没有道歉,没有眼神交流,
132
+ 只有苦咖啡和一个假装 deadline 是生活方式的人……
133
+ ```
docs/02-tech-architecture.md ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — 技术架构
2
+
3
+ ## 系统架构
4
+
5
+ ```text
6
+ Gradio UI
7
+
8
+ Image Input
9
+
10
+ MiniCPM-V / lightweight VLM
11
+
12
+ Object Understanding JSON
13
+
14
+ Fine-tuned small LLM via llama.cpp
15
+
16
+ Persona + Diary JSON
17
+
18
+ Renderer
19
+
20
+ Diary View + Share Card + Trace Export
21
+ ```
22
+
23
+ ## 模型方案
24
+
25
+ | 模块 | 模型 / 工具 | 目的 |
26
+ | -------------------- | ---------------------------- | ------------------------------ |
27
+ | Vision Understanding | MiniCPM-V | 识别物品、外观、场景 |
28
+ | Persona Writer | Fine-tuned small LLM GGUF | 生成人格、日记、对话 |
29
+ | Runtime | llama.cpp / llama-cpp-python | 冲 Llama Champion 勋章 |
30
+ | UI | Gradio Blocks | 官方硬性要求 |
31
+ | Hosting | Hugging Face Space | 官方硬性要求 |
32
+ | Training / Batch | Modal | $250 Modal credits 做训练/批处理 |
33
+ | Demo GPU | HF ZeroGPU / upgraded Space | 按需分配 GPU |
34
+
35
+ > **注意**:MiniCPM-V 4.6 面向 edge deployment,基于轻量 LLM 架构,适合本项目需求。
36
+ > ZeroGPU 是面向 Spaces 的动态 GPU 基础设施,hackathon org 成员有每日免费额度。
37
+
38
+ ## 降级方案
39
+
40
+ 多模态 + llama.cpp 是高风险点,必须准备降级。
41
+
42
+ | 风险 | 主方案 | 降级方案 |
43
+ | -------------------- | ------------------------------------- | ---------------------------------------------- |
44
+ | MiniCPM-V 部署慢 | MiniCPM-V Space 推理 | 预置 example gallery + 手动 object description |
45
+ | VLM llama.cpp 不稳定 | VLM 用 transformers,文本用 llama.cpp | 仍然保证核心文本人格生成走 llama.cpp |
46
+ | 微调来不及 | LoRA 微调 | 用 100 条高质量 SFT 数据 + prompt-tuned style |
47
+ | Space 资源不足 | HF upgraded Space / ZeroGPU | CPU 模式 + 小模型 + 示例缓存 |
48
+ | 视频效果不够 | 实时生成 | 使用 3 个稳定示例录制 Demo |
49
+
50
+ ## 技术栈
51
+
52
+ ```text
53
+ Language: Python
54
+ UI: Gradio Blocks
55
+ Model Runtime: llama.cpp / llama-cpp-python
56
+ VLM: MiniCPM-V or fallback lightweight VLM
57
+ Training: LoRA / PEFT / TRL
58
+ Hosting: Hugging Face Spaces
59
+ Batch/Fine-tune: Modal
60
+ Docs: Markdown
61
+ Package Manager: uv or pip
62
+ ```
63
+
64
+ ## 项目目录结构
65
+
66
+ ```text
67
+ objectverse-diary/
68
+ ├─ app.py
69
+ ├─ README.md
70
+ ├─ AGENTS.md
71
+ ├─ requirements.txt
72
+ ├─ pyproject.toml
73
+ ├─ .env.example
74
+ ├─ .gitignore
75
+ ├─ src/
76
+ │ ├─ config.py
77
+ │ ├─ ui/
78
+ │ │ ├─ layout.py
79
+ │ │ ├─ styles.css
80
+ │ │ └─ copy.py
81
+ │ ├─ models/
82
+ │ │ ├─ vision_runner.py
83
+ │ │ ├─ llama_cpp_runner.py
84
+ │ │ └─ schema.py
85
+ │ ├─ prompts/
86
+ │ │ ├─ object_understanding.py
87
+ │ │ ├─ persona_generation.py
88
+ │ │ └─ diary_generation.py
89
+ │ ├─ renderer/
90
+ │ │ ├─ share_card.py
91
+ │ │ └─ html_templates.py
92
+ │ ├─ traces/
93
+ │ │ ├─ logger.py
94
+ │ │ └─ anonymizer.py
95
+ │ └─ utils/
96
+ │ ├─ json_repair.py
97
+ │ └─ image_utils.py
98
+ ├─ data/
99
+ │ ├─ examples/
100
+ │ ├─ train/
101
+ │ ├─ eval/
102
+ │ └─ traces/
103
+ ├─ scripts/
104
+ │ ├─ generate_dataset.py
105
+ │ ├─ finetune_lora.py
106
+ │ ├─ convert_to_gguf.sh
107
+ │ ├─ run_llama_cpp.sh
108
+ │ └─ export_traces.py
109
+ ├─ docs/
110
+ │ ├─ PRD.md
111
+ │ ├─ FIELD_NOTES.md
112
+ │ ├─ SUBMISSION_GUIDE.md
113
+ │ └─ MODEL_CARD.md
114
+ └─ .codex/
115
+ ├─ project.md
116
+ └─ skills/
117
+ ├─ gradio-ui/SKILL.md
118
+ ├─ model-runtime/SKILL.md
119
+ ├─ dataset-trace/SKILL.md
120
+ ├─ hf-space/SKILL.md
121
+ └─ submission/SKILL.md
122
+ ```
docs/03-dev-schedule.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — 开发计划(Day-by-Day)
2
+
3
+ ```text
4
+ 周期:June 5 - June 15, 2026(共 11 天)
5
+ 目标:完成 MVP、打磨 UI、冲全部徽章、提交视频与社交文案
6
+ ```
7
+
8
+ ---
9
+
10
+ ## Day 1:立项 + 项目骨架
11
+
12
+ **目标:确定项目不可变范围。**
13
+
14
+ - [ ] 创建 GitHub repo
15
+ - [ ] 创建 Hugging Face Space
16
+ - [ ] 创建基础 Gradio app
17
+ - [ ] 写 README 草稿
18
+ - [ ] 确定英文主界面文案
19
+ - [ ] 建立 `AGENTS.md`
20
+ - [ ] 建立 `.codex/skills/`
21
+
22
+ ---
23
+
24
+ ## Day 2:MVP 交互闭环
25
+
26
+ **目标:先不管模型,跑通产品流程。**
27
+
28
+ - [ ] 图片上传
29
+ - [ ] 文本描述输入
30
+ - [ ] personality mode 选择
31
+ - [ ] mock object JSON
32
+ - [ ] mock diary 输出
33
+ - [ ] trace JSON 保存
34
+ - [ ] share card HTML 预览
35
+
36
+ 交付:`Upload → Generate → Diary → Share Card → Trace`
37
+
38
+ ---
39
+
40
+ ## Day 3:接入 VLM
41
+
42
+ **目标:让 AI 真正看图。**
43
+
44
+ - [ ] 接入 MiniCPM-V 或轻量 VLM
45
+ - [ ] 输出 object understanding JSON
46
+ - [ ] 做 JSON repair
47
+ - [ ] 加 example gallery
48
+ - [ ] 缓存示例输出
49
+
50
+ 验收:上传杯子/键盘/鞋子,模型能识别物品并提取外观特征。
51
+
52
+ ---
53
+
54
+ ## Day 4:文本模型 + llama.cpp
55
+
56
+ **目标:让核心人格生成走小模型本地推理。**
57
+
58
+ - [ ] 下载小模型 GGUF
59
+ - [ ] 跑通 llama.cpp / llama-cpp-python
60
+ - [ ] 封装 `generate_persona()`
61
+ - [ ] 封装 `generate_diary()`
62
+ - [ ] README 说明参数量与运行方式
63
+
64
+ 交付:`models/text_model.gguf`、`src/models/llama_cpp_runner.py`、`scripts/run_llama_cpp.sh`
65
+
66
+ ---
67
+
68
+ ## Day 5:训练数据 + 微调准备
69
+
70
+ **目标:冲 Well-Tuned 勋章。**
71
+
72
+ - [ ] 生成 200-500 条 object-persona 样本
73
+ - [ ] 手工精选 50 条高质量样本
74
+ - [ ] 设计 SFT schema
75
+ - [ ] 上传 dataset 到 HF
76
+ - [ ] 准备 LoRA 训练脚本
77
+
78
+ 数据格式示例:
79
+
80
+ ```json
81
+ {
82
+ "instruction": "Create a secret diary persona for this object.",
83
+ "input": {
84
+ "object": "old keyboard",
85
+ "features": ["dusty", "mechanical keys", "developer desk"],
86
+ "mode": "cynical"
87
+ },
88
+ "output": {
89
+ "character_name": "Clackwell",
90
+ "diary": "He calls it productivity. I call it percussion with anxiety.",
91
+ "tags": ["burnout instrument", "debug witness", "plastic philosopher"]
92
+ }
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Day 6:LoRA 微调 + Hub 发布
99
+
100
+ **目标:拿到可展示的自微调模型。**
101
+
102
+ - [ ] 用 Modal credits 进行训练
103
+ - [ ] 导出 LoRA adapter
104
+ - [ ] 发布 HF model repo
105
+ - [ ] app 中加入模型说明
106
+ - [ ] README 加 `Well-Tuned` section
107
+
108
+ 交付:HF model repo、HF dataset repo、train log、model card
109
+
110
+ > ⚠️ Modal credits 兑换码不应公开分享,项目文档里只写"used Modal credits"。
111
+
112
+ ---
113
+
114
+ ## Day 7:UI 魔改
115
+
116
+ **目标:冲 Off-Brand 勋章。**
117
+
118
+ 视觉方向:
119
+
120
+ ```text
121
+ A strange archive room for everyday objects.
122
+ Dark paper texture, amber highlights, typewriter output, museum labels.
123
+ ```
124
+
125
+ 界面布局:
126
+
127
+ ```text
128
+ Left: Object Intake
129
+ Middle: Object File
130
+ Right: Secret Diary
131
+ Bottom: Share Card + Trace
132
+ ```
133
+
134
+ - [ ] 自定义 CSS
135
+ - [ ] 自定义 hero section
136
+ - [ ] 隐藏 Gradio 默认风格
137
+ - [ ] 加 typewriter animation
138
+ - [ ] 做英文主文案 + 中文辅助
139
+ - [ ] 做 6 个示例卡片
140
+
141
+ ---
142
+
143
+ ## Day 8:Trace + Sharing is Caring
144
+
145
+ **目标:公开可复现材料。**
146
+
147
+ - [ ] trace logger
148
+ - [ ] sample traces
149
+ - [ ] prompt templates
150
+ - [ ] dataset preview
151
+ - [ ] 失败案例记录
152
+ - [ ] GitHub repo 整理
153
+
154
+ ---
155
+
156
+ ## Day 9:Field Notes
157
+
158
+ **目标:完成技术博客。**
159
+
160
+ 英文标题:`Building Objectverse Diary: A Small-Model AI Toy Where Everyday Objects Come Alive`
161
+
162
+ 博客结构:
163
+
164
+ 1. Why I built it
165
+ 2. Why Track 2
166
+ 3. Why small models are enough
167
+ 4. Product design
168
+ 5. Model architecture
169
+ 6. Gradio Off-Brand UI
170
+ 7. llama.cpp runtime
171
+ 8. Fine-tuning dataset
172
+ 9. Traces and reproducibility
173
+ 10. What failed
174
+ 11. What I would improve next
175
+
176
+ ---
177
+
178
+ ## Day 10:Demo 视频
179
+
180
+ **目标:视频必须比代码更能打。**
181
+
182
+ 建议长度:90 秒
183
+
184
+ ```text
185
+ 0- 8s What if every object around you had a secret life?
186
+ 8-20s This is Objectverse Diary, a small-model AI toy built with Gradio.
187
+ 20-35s Upload a photo of any everyday object.
188
+ 35-50s A vision model reads the object, then a small fine-tuned model creates its hidden personality.
189
+ 50-70s Now this coffee mug writes its secret diary and complains about its owner.
190
+ 70-82s You can chat with the object and generate a shareable personality card.
191
+ 82-90s Built with small models, Gradio, llama.cpp, public traces, and no commercial cloud APIs.
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Day 11:提交检查
197
+
198
+ - [ ] Space under official org
199
+ - [ ] Demo video ready
200
+ - [ ] Social post ready
201
+ - [ ] README complete
202
+ - [ ] Model parameter count documented
203
+ - [ ] No commercial API
204
+ - [ ] Fine-tuned model linked
205
+ - [ ] Dataset linked
206
+ - [ ] Traces linked
207
+ - [ ] Field Notes linked
208
+ - [ ] UI English-first, Chinese-second
209
+ - [ ] Submit before June 15, 2026
docs/04-hackathon-guide.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — 参赛指南
2
+
3
+ ## 官方硬性要求
4
+
5
+ | 要求 | 操作 |
6
+ | ----------- | ------------------------- |
7
+ | 模型 ≤32B | README 写明所有模型参数量 |
8
+ | Gradio | 全部交互基于 Gradio |
9
+ | HF Space | 托管到官方组织下 |
10
+ | Demo Video | 2 分钟内,重点展示体验 |
11
+ | Social Post | 准备英文社媒文案 |
12
+ | 截止时间 | June 15, 2026 |
13
+
14
+ ---
15
+
16
+ ## 勋章获取方案
17
+
18
+ | 勋章 | 获取方式 | 项目实现 |
19
+ | --------------------- | ---------------- | ----------------------------------------------------------------- |
20
+ | **Off the Grid** | 不调用商业云 API | 推理在 HF Space / Modal / 本地闭环完成 |
21
+ | **Well-Tuned** | 使用自微调模型 | 微调一个小模型做 object persona / diary style JSON 输出 |
22
+ | **Off-Brand** | 深度魔改 Gradio | 用 `gr.Blocks` + CSS + JS 做成"Object Archive"界面 |
23
+ | **Llama Champion** | llama.cpp 驱动 | 文本人格生成模型走 GGUF + llama.cpp / llama-cpp-python |
24
+ | **Sharing is Caring** | 开源数据 / trace | 公开匿名化 object-persona 数据集、sample traces、prompt templates |
25
+ | **Field Notes** | 技术博客 | 写完整英文技术报告 |
26
+ | **OpenBMB Special** | 使用 MiniCPM | VLM 层优先使用 MiniCPM-V 4.6 |
27
+
28
+ ---
29
+
30
+ ## 资源使用指南
31
+
32
+ ### Hugging Face
33
+
34
+ - Space 托管
35
+ - Model repo
36
+ - Dataset repo
37
+ - Demo page
38
+ - ZeroGPU / upgraded Space
39
+
40
+ ### Modal
41
+
42
+ - LoRA fine-tuning
43
+ - batch dataset generation
44
+ - model conversion
45
+ - stress test
46
+
47
+ > ⚠️ 不要在 repo、README、截图、视频或日志中暴露 credit codes。
48
+
49
+ ---
50
+
51
+ ## 提交材料结构
52
+
53
+ ```text
54
+ Submission Package
55
+ ├─ Hugging Face Space URL
56
+ ├─ GitHub Repository URL
57
+ ├─ Demo Video URL
58
+ ├─ Social Media Post URL
59
+ ├─ Fine-tuned Model URL
60
+ ├─ Dataset URL
61
+ ├─ Trace Dataset URL
62
+ ├─ Field Notes Blog URL
63
+ └─ Short project description
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 社交媒体文案
69
+
70
+ ### 英文版
71
+
72
+ ```text
73
+ I built Objectverse Diary for #BuildSmallHackathon.
74
+
75
+ Upload any everyday object.
76
+ A small AI model wakes it up, gives it a secret personality,
77
+ writes its diary, and lets you chat with it.
78
+
79
+ A coffee mug becomes a burned-out philosopher.
80
+ A keyboard becomes a witness to unfinished side projects.
81
+ A shoe becomes a tired travel historian.
82
+
83
+ Built with Gradio, small models, llama.cpp, public traces,
84
+ and no commercial cloud AI APIs.
85
+
86
+ Every object has a secret life.
87
+ ```
88
+
89
+ ### 中文版
90
+
91
+ ```text
92
+ 我做了一个小模型 AI 玩具:Objectverse Diary。
93
+
94
+ 上传任意日常物品,它会被 AI 唤醒,拥有隐藏人格、秘密日记,
95
+ 还能继续和你聊天。
96
+
97
+ 一个杯子可能是厌世哲学家。
98
+ 一个键盘可能见证了 47 个没做完的 side project。
99
+ 一只鞋可能是疲惫的旅行史学家。
100
+
101
+ 英文界面为主,中文为辅。
102
+ 基于 Gradio、小模型、llama.cpp、公开 trace,不调用商业云模型 API。
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Demo 视频脚本
108
+
109
+ ```text
110
+ 0- 8s Hook: What if every object around you had a secret life?
111
+ 8-20s Show upload and mode selection
112
+ 20-45s Show model recognizing the object and generating persona
113
+ 45-70s Show diary and chat interaction
114
+ 70-85s Show share card
115
+ 85-100s Show technical badge checklist
116
+ ```
docs/05-dev-guidelines.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — 开发规范
2
+
3
+ ## 代码规范
4
+
5
+ ### Python
6
+
7
+ - 使用 type hints
8
+ - 保持函数简短
9
+ - 避免隐藏的网络调用
10
+ - 不硬编码 secrets
11
+ - 使用 Pydantic 验证模型 JSON 输出
12
+ - Prompts 放在 `src/prompts/`,不要内联到 UI 代码中
13
+ - UI 文案放在 `src/ui/copy.py`
14
+
15
+ ### Gradio
16
+
17
+ - 使用 `gr.Blocks`,不使用 `gr.Interface` 做主应用
18
+ - 所有主要组件必须有 `elem_id` 或 `elem_classes`
19
+ - 自定义 CSS 放在 `src/ui/styles.css`
20
+ - 英文文案优先,中文辅助在后
21
+ - 应用需在 1366px 桌面和移动端宽度下可用
22
+
23
+ ### Model
24
+
25
+ - 总模型参数量必须有文档记录
26
+ - 不调用商业 API
27
+ - 文本生成支持本地 llama.cpp 路径
28
+ - VLM 降级方案必须有文档
29
+ - 输出必须是结构化 JSON,渲染前验证
30
+
31
+ ### Data
32
+
33
+ - 不包含个人敏感数据
34
+ - Sample traces 必须匿名化
35
+ - 公开数据集使用合成或已授权的示例
36
+ - 原始图片与公开 trace 数据分离
37
+
38
+ ---
39
+
40
+ ## Git 规范
41
+
42
+ ### 分支策略
43
+
44
+ ```text
45
+ main: stable submission branch
46
+ dev: active development branch
47
+ feat/*: feature branches
48
+ fix/*: bug fixes
49
+ docs/*: documentation
50
+ ```
51
+
52
+ ### Commit 格式
53
+
54
+ ```text
55
+ feat: add object persona generator
56
+ fix: repair malformed diary JSON
57
+ docs: add field notes draft
58
+ style: improve off-brand gradio theme
59
+ chore: update model config
60
+ ```
61
+
62
+ ---
63
+
64
+ ## AGENTS.md 模板
65
+
66
+ > 直接放到项目根目录 `AGENTS.md`
67
+
68
+ ```md
69
+ # AGENTS.md
70
+
71
+ ## Project
72
+
73
+ Objectverse Diary is a Build Small Hackathon project.
74
+ It is an English-first, Chinese-second Gradio application where users upload
75
+ everyday object photos and small AI models generate secret object personas,
76
+ diary entries, conversations, and shareable cards.
77
+
78
+ ## Primary Goals
79
+
80
+ 1. Compete in the "An Adventure in Thousand Token Wood" track.
81
+ 2. Keep total model parameters <= 32B.
82
+ 3. Use Gradio for all UI and interaction.
83
+ 4. Host the final app as a Hugging Face Space.
84
+ 5. Avoid commercial cloud AI APIs.
85
+ 6. Maximize hackathon badges.
86
+ 7. Use English as the main UI language and Chinese as secondary helper text.
87
+
88
+ ## Non-Negotiable Rules
89
+
90
+ - Do not use OpenAI, Anthropic, Gemini, Cohere, or other commercial model APIs.
91
+ - Do not leak private credit codes, tokens, emails, or credentials.
92
+ - Do not hardcode secrets.
93
+ - Do not remove Gradio.
94
+ - Do not make the UI Chinese-first.
95
+ - Do not exceed the 32B total model parameter limit.
96
+ - Do not add large features that risk missing the submission deadline.
97
+ - Do not store unconsented personal user data.
98
+
99
+ ## Tech Stack
100
+
101
+ - Python
102
+ - Gradio Blocks
103
+ - Hugging Face Spaces
104
+ - llama.cpp / llama-cpp-python for text generation
105
+ - MiniCPM-V or fallback lightweight VLM for object understanding
106
+ - LoRA / PEFT for fine-tuning
107
+ - Markdown documentation
108
+
109
+ ## UI Requirements
110
+
111
+ The interface must be English-first and Chinese-second.
112
+ Visual style: strange object archive, not default Gradio demo.
113
+ Recommended UI mood: mysterious archive, typewriter diary, warm dark paper,
114
+ amber highlight, museum label, strange but polished.
115
+
116
+ ## Architecture
117
+
118
+ 1. Image upload → 2. Object understanding → 3. Persona generation →
119
+ 4. Secret diary generation → 5. Object chat → 6. Share card rendering →
120
+ 7. Trace export
121
+
122
+ ## Coding Guidelines
123
+
124
+ - Use type hints
125
+ - Prefer small, composable functions
126
+ - Prompts under src/prompts
127
+ - UI copy under src/ui/copy.py
128
+ - CSS under src/ui/styles.css
129
+ - Runtime code under src/models
130
+ - Trace code under src/traces
131
+ - Use Pydantic schemas for model outputs
132
+ - Add clear fallback behavior when model output is invalid
133
+
134
+ ## Testing Requirements
135
+
136
+ - App runs locally
137
+ - App runs on HF Space
138
+ - At least 6 sample objects work
139
+ - Share card renders correctly
140
+ - Trace export works
141
+ - No secret keys committed
142
+ - README links valid
143
+ - Demo video flow reproducible
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Codex Skills 模板
149
+
150
+ 以下 Skills 文件放在 `.codex/skills/` 对应目录下。
151
+
152
+ ### `.codex/project.md`
153
+
154
+ 项目上下文文件,包含 hackathon 信息、核心创意、硬性约束和开发优先级。
155
+
156
+ ### `.codex/skills/gradio-ui/SKILL.md`
157
+
158
+ Gradio Off-Brand UI 规范:布局结构(Hero → Object Intake → Object File → Secret Diary → Chat → Share Card → Trace)、视觉方向(dark paper / amber / typewriter / museum)。
159
+
160
+ ### `.codex/skills/model-runtime/SKILL.md`
161
+
162
+ 模型运行时规范:Vision Runner、Text Runner、Schema 三层架构,以及降级策略(VLM 失败 → 手动描述、文本模型失败 → 模板降级、JSON 异常 → 修复重试)。
163
+
164
+ ### `.codex/skills/dataset-trace/SKILL.md`
165
+
166
+ 数据集与 Trace 规范:训练数据格式、trace 格式、隐私规则、验收标准(≥100 训练样本、≥6 公开 traces)。
167
+
168
+ ### `.codex/skills/hf-space/SKILL.md`
169
+
170
+ HF Space 部署规范:必要文件、README YAML header、部署检查清单。
171
+
172
+ ### `.codex/skills/submission/SKILL.md`
173
+
174
+ 提交规范:8 项交付物、Demo 视频结构、社交文案模板、最终检查清单。
docs/06-readme-template.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Objectverse Diary — README 模板
2
+
3
+ > 初始化项目时直接复制到 `README.md`
4
+
5
+ ---
6
+
7
+ # Objectverse Diary
8
+
9
+ **Every object has a secret life.**
10
+ **万物日记:每个物品都有秘密人生。**
11
+
12
+ Objectverse Diary is a small-model AI toy built for the Build Small Hackathon.
13
+
14
+ Upload a photo of any everyday object. The app wakes it up, gives it a secret personality, writes its diary, and lets you chat with it.
15
+
16
+ ## Track
17
+
18
+ An Adventure in Thousand Token Wood
19
+
20
+ ## Why this fits the track
21
+
22
+ This is a pure digital experience that could not exist without AI:
23
+
24
+ - vision understanding
25
+ - object persona generation
26
+ - first-person diary writing
27
+ - consistent character chat
28
+ - shareable personality cards
29
+
30
+ ## Language
31
+
32
+ The interface is English-first and Chinese-second.
33
+
34
+ ## Badge Targets
35
+
36
+ - [ ] Off the Grid
37
+ - [ ] Well-Tuned
38
+ - [ ] Off-Brand
39
+ - [ ] Llama Champion
40
+ - [ ] Sharing is Caring
41
+ - [ ] Field Notes
42
+
43
+ ## Model Stack
44
+
45
+ - Vision: MiniCPM-V or lightweight VLM fallback
46
+ - Text: fine-tuned small LLM
47
+ - Runtime: llama.cpp / llama-cpp-python
48
+ - UI: Gradio Blocks
49
+
50
+ ## Run Locally
51
+
52
+ ```bash
53
+ pip install -r requirements.txt
54
+ python app.py
55
+ ```
56
+
57
+ ## Project Structure
58
+
59
+ See AGENTS.md and .codex/skills for development rules.
60
+
61
+ ---
62
+
63
+ ## HF Space README YAML Header
64
+
65
+ ```yaml
66
+ ---
67
+ title: Objectverse Diary
68
+ emoji: 🗝️
69
+ colorFrom: amber
70
+ colorTo: gray
71
+ sdk: gradio
72
+ app_file: app.py
73
+ pinned: false
74
+ ---
75
+ ```
docs/FIELD_NOTES.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Field Notes
2
+
3
+ Working title:
4
+
5
+ `Building Objectverse Diary: A Small-Model AI Toy Where Everyday Objects Come Alive`
6
+
7
+ ## Draft Outline
8
+
9
+ 1. Why I built it
10
+ 2. Why Track 2
11
+ 3. Why small models are enough
12
+ 4. Product design
13
+ 5. Model architecture
14
+ 6. Gradio Off-Brand UI
15
+ 7. llama.cpp runtime
16
+ 8. Fine-tuning dataset
17
+ 9. Traces and reproducibility
18
+ 10. What failed
19
+ 11. What I would improve next
20
+
21
+ ## Status
22
+
23
+ Not started. This file is a placeholder for Day 9.
docs/MODEL_CARD.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model Card
2
+
3
+ ## Status
4
+
5
+ Not started. No model has been selected, fine-tuned, converted, or published yet.
6
+
7
+ ## Planned Components
8
+
9
+ - Vision understanding: MiniCPM-V or lightweight fallback VLM.
10
+ - Text generation: fine-tuned small LLM.
11
+ - Runtime: llama.cpp / llama-cpp-python.
12
+
13
+ ## Required Notes
14
+
15
+ - Total model parameter count must remain <= 32B.
16
+ - No commercial model APIs.
17
+ - Fallback behavior must be documented.
18
+ - Dataset provenance and privacy rules must be documented before release.
docs/README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Documentation Index
2
+
3
+ This folder contains the planning source of truth for Objectverse Diary.
4
+
5
+ ## Core Docs
6
+
7
+ - `00-project-overview.md`: product positioning, core flow, language rules, hard constraints.
8
+ - `01-prd.md`: users, MVP scope, acceptance criteria, output examples.
9
+ - `02-tech-architecture.md`: planned architecture, model stack, fallback strategy, target directory tree.
10
+ - `03-dev-schedule.md`: day-by-day hackathon plan.
11
+ - `04-hackathon-guide.md`: badges, resources, submission package, social copy.
12
+ - `05-dev-guidelines.md`: coding, Gradio, model, data, Git, AGENTS, and Codex skills guidance.
13
+ - `06-readme-template.md`: original README template.
14
+
15
+ ## Added Skeleton Docs
16
+
17
+ - `FIELD_NOTES.md`: future technical blog draft.
18
+ - `MODEL_CARD.md`: future model documentation.
19
+ - `SUBMISSION_GUIDE.md`: final submission checklist.
docs/SUBMISSION_GUIDE.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Submission Guide
2
+
3
+ ## Required Package
4
+
5
+ - [ ] Hugging Face Space URL
6
+ - [ ] GitHub Repository URL
7
+ - [ ] Demo Video URL
8
+ - [ ] Social Media Post URL
9
+ - [ ] Fine-tuned Model URL
10
+ - [ ] Dataset URL
11
+ - [ ] Trace Dataset URL
12
+ - [ ] Field Notes Blog URL
13
+ - [ ] Short project description
14
+
15
+ ## Final Checks
16
+
17
+ - [ ] Space is under the official organization.
18
+ - [ ] Demo video is under 2 minutes.
19
+ - [ ] README includes model parameter counts.
20
+ - [ ] No commercial cloud AI APIs are used.
21
+ - [ ] Fine-tuned model is linked.
22
+ - [ ] Dataset is linked.
23
+ - [ ] Traces are linked.
24
+ - [ ] Field Notes are linked.
25
+ - [ ] UI remains English-first and Chinese-second.
26
+ - [ ] Submission is complete before June 15, 2026.
pyproject.toml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "objectverse-diary"
3
+ version = "0.0.0"
4
+ description = "A small-model AI toy that turns everyday objects into secret diary characters."
5
+ requires-python = ">=3.10"
6
+ dependencies = []
7
+
8
+ [tool.objectverse-diary]
9
+ status = "structure-only"
10
+ implementation = "not-started"
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # Dependencies will be added when implementation starts.
2
+ # Planned stack: gradio, llama-cpp-python, pydantic, pillow, MiniCPM-V runtime tools.
scripts/README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Scripts
2
+
3
+ Planned automation scripts for dataset generation, fine-tuning, GGUF conversion, llama.cpp runtime, and trace export.
4
+
5
+ Expected files during implementation:
6
+
7
+ - `generate_dataset.py`
8
+ - `finetune_lora.py`
9
+ - `convert_to_gguf.sh`
10
+ - `run_llama_cpp.sh`
11
+ - `export_traces.py`
12
+
13
+ Current status: no implementation code.
src/README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Source Skeleton
2
+
3
+ This directory is reserved for application source code.
4
+
5
+ Current status: structure-only. No implementation code has been added yet.
6
+
7
+ ## Planned Areas
8
+
9
+ - `ui/`: Gradio layout, CSS, and copy.
10
+ - `models/`: vision runner, llama.cpp text runner, and schemas.
11
+ - `prompts/`: object understanding, persona generation, and diary generation prompts.
12
+ - `renderer/`: share card and HTML rendering.
13
+ - `traces/`: trace logging and anonymization.
14
+ - `utils/`: JSON repair and image utilities.
src/prompts/README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Prompts
2
+
3
+ Planned prompt templates.
4
+
5
+ Expected files during implementation:
6
+
7
+ - `object_understanding.py`
8
+ - `persona_generation.py`
9
+ - `diary_generation.py`
10
+
11
+ Current status: no implementation code.
src/renderer/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Renderer
2
+
3
+ Planned rendering layer for diary views and share cards.
4
+
5
+ Expected files during implementation:
6
+
7
+ - `share_card.py`
8
+ - `html_templates.py`
9
+
10
+ Current status: no implementation code.
src/traces/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Traces
2
+
3
+ Planned trace logging and anonymization layer.
4
+
5
+ Expected files during implementation:
6
+
7
+ - `logger.py`
8
+ - `anonymizer.py`
9
+
10
+ Current status: no implementation code.
src/ui/README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UI
2
+
3
+ Planned Gradio Blocks UI layer.
4
+
5
+ Expected files during implementation:
6
+
7
+ - `layout.py`
8
+ - `styles.css`
9
+ - `copy.py`
10
+
11
+ Current status: no implementation code.
src/utils/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Utilities
2
+
3
+ Planned shared helpers.
4
+
5
+ Expected files during implementation:
6
+
7
+ - `json_repair.py`
8
+ - `image_utils.py`
9
+
10
+ Current status: no implementation code.