跳转到内容

C403 实验:针对写明的用途选择并获取一个数据集

这个实验把一个用途从一句话带到一份有记录的决定:用哪个数据集,按什么条款用。它使用 Hugging Face Hub 的公开 API 及其 Python 客户端 huggingface_hub,因为 2025–2026 年的大多数第一人称发布都托管在那里。Hugging Face 之外的数据集,例如 Ego4D,在第 6 步中讲。

下面的每条命令都抄自 Hugging Face 文档,或者遵循 huggingface_hub 客户端文档所写的形式,每条都于 2026-11-08 在示例数据集上运行过;每一步都链接了来源。方括号标出由你填写的值。所示的输出是 API 在那一天返回的内容:条款会变,所以在依赖它们之前,自己运行这些命令。

先学完第 1 至第 4 课,并把检查清单放在手边。本实验中的任何内容都不是法律意见:它收集条款怎么写,好让你或法律顾问作决定。

写一段话,回答四个问题。后面的每一步都对照它来核对数据集。

  1. 用途。只做研究,还是模型、它的输出或数据最终会进入产品?你会再分发数据或它的转换副本吗?
  2. 标签。数据必须带有什么:只要视频、相机位姿、3D 手部关键点、身体姿态、语言、动作?
  3. 采集。它必须与你自己的采集设备有多接近:头上是双目或更多相机、腕部视角、手持夹爪?
  4. 预算。你能花多少存储空间和下载时间,是否这周就要用(一次人工审核可能要好几天)?

本实验中的示例:一个商业模型,在家庭和工作场所中由头戴视频预测 3D 手部轨迹;我们不会再分发数据。

第 2 步:从实用指南列出候选名单

Section titled “第 2 步:从实用指南列出候选名单”

从按任务选择表格及其指向的分类页面开始,并从许可协议表抄下每个候选数据集的数据许可协议和访问方式。对于这个示例,机器人学习和夹爪这两行给出一份由五个 Hugging Face 仓库组成的候选名单,其中每一个实用指南都有介绍:

候选 为什么在名单上
genrobot2025/Gen-HumanEgo 多相机头戴设备,每只手的 3D 手部关键点和 MANO 参数
builddotai/Egocentric-10K 大型工厂语料库(小时数是卡片声明),单目,没有手部标签
simple-world-lab/HiFi-UMI-2K 头部双目加腕部视角,双手在同一个世界坐标系中,类似手套的夹爪
projectaria/Nymeria 头部和腕部的 Aria 设备,全身动作
IPEC-COMMUNITY/FastUMI_100k_lerobot LeRobot 格式的手持夹爪轨迹

EgoDex 在标签上是合适的,但它是从 Apple 的仓库下载的,不在 Hugging Face 上,而且它的 CC BY-NC-ND 条款排除了商业训练(用于机器人学习的第一人称数据集)。

第 3 步:通过 API 读出许可协议标签和访问门槛

Section titled “第 3 步:通过 API 读出许可协议标签和访问门槛”

按 hf CLI guide 给出的方式安装客户端:

终端窗口
pip install -U "huggingface_hub"

HfApi.dataset_info 调用 Hub 的 /api/datasets/{repo_id} 端点。它的 expand 参数把返回内容限制在你列出的属性上,其中包括 "gated"、"cardData" 和 "tags"(dataset_info 的 docstring)。把下面的内容保存为 check_licence.py:

import sys
from huggingface_hub import HfApi
api = HfApi()
for repo_id in sys.argv[1:]:
info = api.dataset_info(repo_id, expand=["gated", "cardData", "tags"])
card = info.card_data.to_dict() if info.card_data else {}
print(repo_id)
print(" gated: ", info.gated)
print(" license: ", card.get("license"))
print(" license_name: ", card.get("license_name"))
print(" license_link: ", card.get("license_link"))
print(" gate fields: ", list((card.get("extra_gated_fields") or {}).keys()))

在候选名单上运行它。不需要账号:

终端窗口
python check_licence.py genrobot2025/Gen-HumanEgo builddotai/Egocentric-10K \
simple-world-lab/HiFi-UMI-2K projectaria/Nymeria IPEC-COMMUNITY/FastUMI_100k_lerobot

不用 Python 也能得到同样的返回内容,例如 curl -s "https://huggingface.co/api/datasets/projectaria/Nymeria?expand=gated&expand=cardData"。

你应该看到,对于这个示例,在 2026-11-08:

仓库 gated license 门槛表单字段
Gen-HumanEgo auto cc-by-sa-4.0 机构、预期用途、对预期用途的描述
Egocentric-10K auto apache-2.0 名和姓、所属机构、电子邮箱、电话号码、国家
HiFi-UMI-2K False cc-by-4.0 无
Nymeria False cc-by-nc-4.0 无
FastUMI 100K False 无 无

gated 是 False、"auto" 或 "manual",如客户端的 DatasetInfo 文档所写。Nymeria 在这里退出候选名单:不管下载多么开放,CC BY-NC 都禁止主要以获取商业利益为目的的使用。

如果失败:RepositoryNotFoundError 表示 repo_id 写错了,或者仓库是私有的。license 为 other 或没有,都不算答案:转到第 4 步。

标签不是许可协议的全部(第 4 课)。下载每张卡片并在其中搜索。带 repo_type="dataset" 的 hf_hub_download 是 Hub 的下载指南使用的形式;示例中需申请访问的仓库,其卡片不用 token 就下载下来了。保存为 read_card.py:

import sys
from huggingface_hub import hf_hub_download
path = hf_hub_download(sys.argv[1], "README.md", repo_type="dataset")
for n, line in enumerate(open(path, encoding="utf-8"), 1):
if any(w in line.lower() for w in ("licen", "commercial", "consent", "hours", "mano", "smpl")):
print(n, line.rstrip())
终端窗口
python read_card.py IPEC-COMMUNITY/FastUMI_100k_lerobot
python read_card.py genrobot2025/Gen-HumanEgo

你应该看到 FastUMI 的 README 写明该数据集以 Apache-2.0 License 发布,尽管它的元数据中没有标签;以及 Gen-HumanEgo 的卡片在它的标签中列出 “3D hand keypoints, MANO parameters, and full hand geometry”(意为:3D 手部关键点、MANO 参数和完整的手部几何)。

记下许可协议的原句及其所在的行、知情同意声明(如果有的话),以及每一个小时数,并标明是卡片的声明。

第 5 步:把每次发布上的许可协议分开

Section titled “第 5 步:把每次发布上的许可协议分开”

对每个剩下的候选数据集,填写四行(第 4 课):

  • 数据许可协议:来自卡片或许可协议页面(第 3 和第 4 步)。
  • 论文许可协议:来自 arXiv 或期刊页面。它只涵盖论文;把它记下来,免得有人把两者混淆。
  • 代码许可协议:来自加载程序所在的仓库。它不涵盖数据。
  • 身体模型许可协议:如果有任何标签是 MANO、SMPL 或 SMPL-X 参数,就适用该模型自己的许可协议,而 MANO 的许可协议是非商业的(身体模型的许可协议)。

对于这个示例,Gen-HumanEgo 的数据许可协议(CC BY-SA 4.0)允许商业使用,并要求你分发的改编版本保持 CC BY-SA,但它的 MANO 参数引入了 MANO 许可协议。你可以使用哪些标签字段,是一个要问法律顾问的问题,并照此写下来。Egocentric-10K 在 Apache-2.0 下允许商业训练,但不带手部标签,所以它适合预训练阶段,而不满足对标签的要求。

Which licence covers what, and gate versus licence Two panels about dataset licences. Panel 1, one release, several licences: five layers of a dataset release, each with its rule and an example. The paper, on arXiv or in a journal, covers its text and figures only (Ego-1K's paper is CC BY 4.0). The code, loaders and tools on GitHub, covers the code only (the Ego4D repository is MIT). The data files, video, sensor streams and annotations, govern training (Ego-1K's data is under the FAIR Noncommercial Research License). Body-model labels, MANO, SMPL or SMPL-X parameters, add the body model's own licence (HOT3D's hand annotation files are CC BY-NC-SA). Merged corpora built from other datasets keep each part's licence (OpenEgo has six sources with six licences). A bracket groups the last three: check all three before commercial training; the Hugging Face tag can be missing or say 'other'. Panel 2, how you download is not what you may do: a two-by-two grid of access route against whether commercial training is allowed. Open download and commercial training allowed: HiFi-UMI-2K (CC BY 4.0), Gen-EgoData (CC BY-SA 4.0), FastUMI 100K (Apache-2.0), UMI-FT (MIT). Open download but non-commercial: Ego-1K (FAIR Noncommercial), Nymeria (CC BY-NC 4.0), EgoDex (CC BY-NC-ND), and the Aria Everyday Activities and Aria Digital Twin agreements. Form, review or agreement and commercial training allowed: Egocentric-10K and 100K (Apache-2.0), Gen-HumanEgo (CC BY-SA 4.0), Lightwheel's EgoStandard and EgoPro (by the licence name commercial-training-no-resale), the Mundo AI sample (CC BY 4.0). Form, review or agreement and non-commercial: Xperience-10M (manual review plus a DocuSign agreement). A note: Ego4D and Ego-Exo4D use signed agreements that, as quoted on the page, cover research and commercial use with restrictions; read the agreement itself. Licences as stated on each card, read 2026-11-07. Dataset licences: which file, and which gate Examples from the cards and agreements on this page. 1. One release, several licences Paper arXiv or journal article covers the text and figures only Ego-1K paper: CC BY 4.0 Code loaders and tools on GitHub covers the code only Ego4D repository: MIT Data files video, sensor streams, annotations governs training Ego-1K data: FAIR Noncommercial Body-model labels MANO, SMPL, SMPL-X parameters add the model's own licence HOT3D hand files: CC BY-NC-SA Merged parts a corpus built from other datasets each part keeps its licence OpenEgo: six sources, six licences Check all three before commercial training. The Hugging Face tag can be missing or 'other'. 2. How you download is not what you may do Commercial training allowed Not allowed (non-commercial) Open download no form Form, review or agreement HiFi-UMI-2K (CC BY 4.0) Gen-EgoData (CC BY-SA 4.0) FastUMI 100K (Apache-2.0) UMI-FT (MIT) Ego-1K (FAIR Noncommercial) Nymeria (CC BY-NC 4.0) EgoDex (CC BY-NC-ND) Aria AEA, ADT (agreements) Egocentric-10K/100K (Apache-2.0) Gen-HumanEgo (CC BY-SA 4.0) Lightwheel (licence name) Mundo AI sample (CC BY 4.0) Xperience-10M (manual review + DocuSign) Ego4D and Ego-Exo4D: signed agreements that, as quoted on this page, cover research and commercial use with restrictions; read the agreement itself. Licences as stated on each card, read 2026-11-07.
Top: the parts of one dataset release and which licence governs each, with an example from this page. A paper's licence covers the paper (Ego-1K's is CC BY 4.0) and a repository's covers its code (Ego4D's is MIT); training is governed by the data licence (Ego-1K: FAIR Noncommercial), plus the body model's licence for MANO, SMPL or SMPL-X labels (HOT3D's hand files are CC BY-NC-SA) and each source's licence in a merged corpus (OpenEgo). Bottom: the access route and the licence are independent. Some datasets download with no form yet forbid commercial training (Ego-1K, Nymeria, EgoDex, the Aria agreements), while others ask for a form or review and allow it (Egocentric-10K/100K, Gen-HumanEgo, Lightwheel by its licence name, the Mundo AI sample). Licences as stated on each card or agreement, read 2026-11-07; not legal advice.

申请访问一个需申请访问的 Hugging Face 数据集 “can only be done from your browser”(意为:只能在你的浏览器中完成)(Gated datasets)。在登录状态下打开数据集页面,把表单填写完整,然后提交。gated: auto 时访问权限立即授予;gated: manual 时由维护者决定,这可能要好几天。

要从脚本下载一个需申请访问的数据集,先登录一次,如同一页面所示:

终端窗口
hf auth login

然后在长时间的任务之前检查你的 token 是否有访问权限。如果仓库需申请访问而你没有获得授权,HfApi.auth_check 会抛出 GatedRepoError(它的 docstring):

from huggingface_hub import HfApi
from huggingface_hub.errors import GatedRepoError
try:
HfApi().auth_check("[REPO_ID]", repo_type="dataset")
print("access OK")
except GatedRepoError:
print("no access yet") # request it in the browser

你应该看到,在不登录的情况下,builddotai/Egocentric-10K 得到 no access yet,simple-world-lab/HiFi-UMI-2K 得到 access OK。

Hugging Face 之外:Ego4D 和 Ego-Exo4D 各自需要自己的签署协议,然后等待约 48 小时拿到 AWS 凭证,然后使用 ego4d 或 egoexo CLI(里程碑数据集,获取数据)。Ego4D 的文档指出 “once approved your access credentials will expire in 14 days”(意为:一经批准,你的访问凭证将在 14 天后过期)(Ego4D: Start Here),所以在申请之前先把下载规划好。

Hub 的 OpenAPI reference 记载了 GET /api/datasets/{namespace}/{repo}/treesize/{rev}/{path},它返回一个仓库在某个修订版本下以字节计的总大小:

终端窗口
curl -s https://huggingface.co/api/datasets/[NAMESPACE]/[REPO]/treesize/main

你应该看到,对于 genrobot2025/Gen-EgoData,{"path":"/","size":47636792863},约 47.6 GB,与实用指南对该样本给出的 47.6 GB 相符。

要得到逐个文件的列表,hf CLI guide 记载了一种什么也不下载的试运行:

终端窗口
hf download [REPO_ID] --repo-type dataset --dry-run

你应该看到类似 [dry-run] Will download 502 files (out of 502) totalling 47.6G. 的一行,后面是每个文件及其大小。把总量与卡片写明的大小作比较;存放同一批 episode 两种格式的仓库,大约是一份副本的两倍(第 3 课)。

第 8 步:下载一个样本并自己统计

Section titled “第 8 步:下载一个样本并自己统计”

先只下载一小部分,使用 CLI 指南记载的 --include 模式,并再次加上 --dry-run,直到这一小部分是你想要的大小:

终端窗口
hf download [REPO_ID] --repo-type dataset --include "[PATTERN]" --local-dir [FOLDER]

然后统计你手里的内容,而不是相信对外宣称的数字(第 3 课)。对于 LeRobot 数据集,meta/info.json 中有 total_episodes、total_frames 和 fps(lerobot 的 dataset_metadata.py)。保存为 count.py:

import json, sys
from huggingface_hub import hf_hub_download
info = json.load(open(hf_hub_download(sys.argv[1], "meta/info.json", repo_type="dataset")))
print("codebase_version:", info.get("codebase_version"))
print("episodes:", info["total_episodes"], "frames:", info["total_frames"], "fps:", info["fps"])
print("recorded hours:", round(info["total_frames"] / info["fps"] / 3600, 1))
终端窗口
python count.py lerobot/umi_cup_in_the_wild

你应该看到 codebase_version: v3.0、episodes: 1447 frames: 699432 fps: 10 和 recorded hours: 19.4,与开放的手持夹爪数据集上的统计相符。对于 MCAP 或 WebDataset 发布,从卡片记载的逐文件元数据来统计。

然后打开几个 episode 看一看:你需要的标签是否存在并且合理,是否有置信度或有效性字段,相机视角是否与你的采集设备相似(第 2 课)?

为你保留的每个数据集填写检查清单的签字确认部分,并把它与你的训练配置放在一起:

  • 你下载的仓库和修订版本(commit)。一个 Hub 仓库就是一个 Git 仓库,它的文件、卡片和许可协议文本在你核对之后都可能改变;有些发布放在可变的存储中,在那里,定义已发布内容的是当前的文件列表,而不是一个固定的版本(第 3 课)。commit 哈希确切地固定了你的决定所针对的版本;
  • 按原文写明的数据许可协议,附原句,再加上论文、代码和身体模型的许可协议;
  • 门槛类型、获得访问权限的日期,以及你签署的任何协议;
  • 卡片声明的小时数和你自己的统计;
  • 这个决定的依据,以及留给法律顾问的任何事项。

提示词页面上有一条提示词,可以根据你的笔记起草这份记录。