Files
FacereDataset/docs/sources/hf_bshada_open_schematics.md
Zhang Jiahao 53b7648984 Add HF bshada/open-schematics to Phase 1 plan
Why:
- Charles 点名把该 HF 数据集纳入第一批。它是已预处理包(非待爬网站),
  和 oshwhub 的抓取逻辑不一样,先把决策面在 plan 里讲清楚,再动手拉。
- 与 oshwhub (EasyEDA 生态) 互补,补 KiCad 原生路径。

What:
- docs/sources/hf_bshada_open_schematics.md: 调研文档
  - 78 parquet shards, 6.4 GB 总量
  - CC-BY-4.0 商用友好
  - 字段:.kicad_sch 源 / PNG / 组件列表 / JSON / YAML / name / desc
  - 镜像方案(整包存 data/external/..., 不拆 per-project)
  - .gitattributes 建议(data/external/**/*.{parquet,png} → LFS)
- plan.md §1.5: 阶段说明 + 待 Charles 批 6.4 GB 预算
- README.md 数据源表: 加一行
- log.md: 本次记录

下载未触发,等 Charles 拍板。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 19:51:24 +08:00

108 lines
4.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HF Dataset: bshada/open-schematics
**URL**https://huggingface.co/datasets/bshada/open-schematics
**调研日期**2026-04-23
**性质**:第三方**已预处理**数据集(非待爬网站),镜像导入。
## 概要
| 字段 | 值 |
|------|---|
| 作者 | bshada |
| License | **CC-BY-4.0** |
| 更新 | 2025-12-17 |
| 下载量 | 1 769 |
| Likes | 160 |
| 规模 | 10K 100K 条 (tag `size_categories: 10K<n<100K`) |
| 存储 | 78 parquet shards, **6.4 GB** (`data/train-000XX-of-00078.parquet`) |
| 封面 | `open-schematics.png` (6.2 MB) |
| Tags | kicad, schematics, pcb, electronics, hardware, circuit-design |
## 数据结构(每条记录)
| 字段 | 类型 | 说明 |
|------|------|------|
| `schematic` | string | 原始 schematic 文件内容(主要是 `.kicad_sch` |
| `image` | image (PNG) | schematic 渲染图 |
| `components_used` | list[string] | 元件名列表(从 library symbol 提取) |
| `json` | string | JSON 结构化表示 |
| `yaml` | string | YAML 元数据 |
| `name` | string | 项目名 |
| `description` | string | 项目描述 |
| `type` | string | 文件扩展名 (`.kicad_sch` 等) |
数据来源:公开硬件 repo作者未列具体来源已做以下处理
- 空 schematic无元件/符号)过滤
- 元件名从 library symbol 抽取
- 生成可视化 PNG
- 多格式raw / JSON / YAML并存
## 为什么值得纳入
1. **即用**:已结构化,训练 `text → schematic` / `image → components` / `schematic → description` 几类 SFT 都能直接用
2. **KiCad 原生**:补上我们 oshwhub 路径EasyEDA以外的主流 EDA 生态
3. **License 好**CC-BY-4.0,商用仅需署名
4. **小**6.4 GB vs oshwhub 全量估算 110 GB边际成本可接受
## 接入方案Option A镜像
**不按"每项目一文件夹"解**,因为这是整包发布的数据集,记录 10K+,拆细反而破坏结构。
目录:
```
data/external/huggingface/bshada--open-schematics/
├── README.md # 原作者 README
├── ATTRIBUTION.md # 我方追加:来源 + license + crawled_at
├── open-schematics.png # 封面LFS
├── data/*.parquet # 78 shardsLFS
└── _source.json # HF API 元数据快照sha / lastModified / downloads / tags
```
下载方式:
```bash
# 用 huggingface-cliuv 装 hf_hub或 datasets 库,断点续
uv pip install huggingface_hub
huggingface-cli download bshada/open-schematics \
--repo-type dataset \
--local-dir data/external/huggingface/bshada--open-schematics
```
或轻量走 `hf_hub_download` + 循环:
```python
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="bshada/open-schematics",
repo_type="dataset",
local_dir="data/external/huggingface/bshada--open-schematics",
)
```
## .gitattributes 改动
```
data/external/**/*.parquet filter=lfs diff=lfs merge=lfs -text
data/external/**/*.png filter=lfs diff=lfs merge=lfs -text
```
## 下游消费
我们的 `scripts/build_index.py` 目前按 `data/raw/*/*/metadata.json` 汇总,
不会自动收录这个。需要:
-`build_index.py` 加一个 external datasets 段(从 `_source.json` 读)
- 或者单独维护 `datasets.md`
推荐:**单独 `datasets.md`**,因为 per-project 索引和 HF 包索引是两种不同物种,合并反而乱。
## 风险
- **License 署名**:下游产出(模型 card / 论文)必须标注 "This dataset uses schematics from bshada/open-schematics (CC-BY-4.0)"。加 `ATTRIBUTION.md` 落地
- **数据来源不透明**:作者没公开具体来源 repo 列表,去重时无法对齐到上游项目(可能与 oshwhub / KiCad repo 的部分项目重叠)
- **KiCad 版本**`.kicad_sch` 语法随 KiCad 5/6/7/8 大改,没有版本标注 → 下游若要 round-trip 需探测
## 待 Charles 决策
1. 6.4 GB LFS 预算批准吗?
2. 如果 oshwhub 放量 + HF 镜像并行Gitea 实例磁盘要确认(之前已标记:需 `df -h` 看容量)
3. 立刻拉还是排到 oshwhub 放量之后?