indices_to_labels — REPRCONV index op

• 数据种类:indices → labels

• 调用: import fullseye as fs; fs.ledger.indices_to_labels(indices)(要直接调用实现,import reprconv; reprconv.indices_to_labels(indices);从台账取用则 opsreprconv.get("indices_to_labels"))

用法

索引 (N,) → 选择掩码 labels。indices 的出口(可逆)。

构造长度为 max(indices) + 1 的 1-D 标签数组,在选中的位置放 1。indices -> labels -> indices 按位一致(除去重复与顺序)。反方向 labels -> indices -> labels 会丢掉末尾的背景 (长度被截为 max_index + 1)—— 这是信息的损失而不是 bug,所以在 labels_to_indices 的 docstring 中写明了量。

Args:

indices: (N,) 的非负整数数组。

Returns:

(max + 1,) 的 int64 标签数组(选中 = 1,背景 = 0)。

Raises:

ValueError: 不是 1-D / 负 / 空 / 超过上限。

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• representation_conversion — py -3.11 examples/representation_conversion.py

类型可衔接的下一个算子(可接受 labels 作为输入)

labels_to_indices

同类别(index)

labels_to_indices · select_points


*Provenance: reprconv.py — REPRCONV 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.