Classifying Piece Sides For Border First 标志

Classifying Piece Sides For Border First

组织
runtime-si
classifying-piece-sides-for-border-first

Types a jigsaw piece's four sides flat / tab / blank from a top-down mask and calls it a corner, edge or interior piece - the side lines are found as the direction (1 degree steps) whose projections pile the outline's points into the sharpest peak near each extreme (straight shoulders and flat sides), then each side's middle stretch is a tab where it reaches past its line by 12 % of the side, a blank where it falls behind it, flat otherwise. Returns the outward direction of each flat side (where the board's edge must lie), sides near the threshold as uncertain, and, for many pieces, the ids sorted into corners, edges and interiors for a border-first build. Use when sorting loose pieces for a frame-first strategy, or to orient a border piece before placing it, from wrist-camera masks of pieces lying flat; CPU only, about 8 ms a piece.

概览

发布者runtime-si
代码仓库RoboSkillHub
技能名称classifying-piece-sides-for-border-first
星标数
242
复刻数
27
附带文件
2
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 runtime-si 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Classifying Piece Sides For Border First AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/runtime-si/RoboSkillHub/tree/main/skills/classifying-piece-sides-for-border-first
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/runtime-si/RoboSkillHub.git /tmp/RoboSkillHub
mkdir -p .claude/skills
cp -r /tmp/RoboSkillHub/skills/classifying-piece-sides-for-border-first .claude/skills/classifying-piece-sides-for-border-first
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Classifying Piece Sides For Border First,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Classifying Piece Sides For Border First。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Classifying Piece Sides For Border First 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

classifying-piece-sides-for-border-first

A border-first build needs the corner and edge pieces out of the pile first, and needs to know which way each one's straight side faces. A piece's shape tells both: a flat side is a straight line from corner to corner; a tab bulges past that line, a blank cuts behind it.

How

  1. The mask's largest component (closed by 3 px) is outlined and resampled to 480 points by arc length.
  2. Side lines. For each direction over a quarter turn (1 degree steps) the outline is projected on the direction and its normal. A straight shoulder or flat side piles its points into one or two histogram bins (1.5 % of the extent); knobs spread theirs. In the outer half toward each end the densest pair of adjacent bins is that side's line. The direction with the highest sum of the four peaks wins. (A first version took the minimum-area rectangle of the mask opened by a knob-sized disk: a piece with two deep blanks split in two, and knob roots pushed the rectangle out - 194 / 300 side sequences right on the classic cut, against 299 / 300 now.)
  3. Typing. Each outline point goes to the side whose line is nearest in the rectangle's normalised frame. In the middle 70 % of a side, the largest signed distance past (+) or behind (-) the line, over the side's length, decides: over 0.12 tab, under -0.12 blank, else flat. Within 0.35 x 0.12 of the threshold the side is uncertain.
  4. Two flat sides: corner; one: edge; none: interior; more: unknown (uncertain). flat_normals_deg are the outward normals of the flat sides (image degrees, counter-clockwise from +x with y up).

Inputs

  • piece_mask: one top-down mask (uint8 or bool), the whole piece, nothing else; or pieces: [{"id", "mask"}, ...].
  • max_uncertain (0): uncertain sides tolerated before a piece is uncertain.

Outputs

piece_class, side_types (counter-clockwise from the body's +u side), side_normals_deg, flat_normals_deg, side_deviations, uncertain_sides, body_angle_deg; for a list, pieces (per piece the same), corners, edges, interiors, uncertain (ids), detail.

Measured

tests/bundles/_classify_sides_eval.py.

Generated pieces (every piece of three 10 x 10 cuts, mask at 64 px a cell, turned at random, outline jittered up to 1 px):

cutclass rightsides rightwhole sequence right
classic300 / 3001199 / 1200299 / 300
random-cut270 / 300 (13 no body found)1040 / 1148191 / 287

The random-cut generator's deep, angled blanks are harder than real cuts; its misses are mostly edge pieces read as interior (16).

Real piece photos. PuzzleMap (https://huggingface.co/datasets/pablo-moreira/puzzle-map, CC-BY-4.0, not redistributed): 654 single-piece photos with per-side labels, sampled to 154 corner, 250 edge and 250 interior pieces. No learned segmenter was used: the mask is GrabCut inside the annotated box. Many photos have fingers over the outline or a strong shadow beside the piece. Side sequences are compared up to a quarter turn.

  • Class: 449 / 654 right (69 %). Pieces with no uncertain side: 387 / 482 right (80 %). 40 masks gave no square body.

  • Sides: 2135 / 2456 right; whole sequence 369 / 614.

  • By photo set: the 120-piece Avengers set, 212 / 262 (81 %); 195 / 225 (87 %) with no uncertain side. The "camera" set (hand-held, cluttered), 36 / 100.

  • Confusion:

    true \ predictedcorneredgeinteriorunknown / error
    corner (154)103251016
    edge (250)401692318
    interior (250)84417721

    In a sample of 12 failures, most masks had a shadow or a finger merged into them, filling a blank (it then reads flat).

  • Time: median 8 ms a piece.

Orientation for a slot

Given expected_sides (the slot's south, east, north and west as the piece must show them), yaw_deg is the turn at which the piece's sides read that way, sides_agree how many do, and orientations_tied how many turns agree as well. Under 4 / 4, or tied, the route is mismatch. In the first end-to-end chain in the twin (docs/jigsaw-e2e), taking the best of 3 / 4 put a piece 180 degrees off: one blank had been read as a tab.

Limits

  • The mask decides. On masks of generated pieces it is near perfect; on GrabCut masks of photos it is 69-81 %. A wrist camera over pieces lying flat on a plain mat, with a learned segmenter (sam3), should sit near the better end; that is not measured here.
  • Shadows and fingers merged into a blank make it look flat: an interior piece reads as an edge. Light from above, and take the mask from depth where the piece stands 2 mm proud of the mat.
  • Square-ish bodies only (aspect up to 1.6); a piece cut from an irregular grid or a whimsy cut is out of scope.
  • An edge piece misread as interior is only found late (it never joins the frame); one misread as a corner is placed wrongly and found by backtracking-a-wrong-placement.

The constants, and why

CONTOUR_POINTS 480, ANGLE_STEP_DEG 1, BIN_FRACTION 0.015, MAX_ASPECT 1.6, MIDDLE 0.7, KNOB_FRACTION 0.12 (knobs reach 0.20-0.30 of a side, a flat side's wobble under 0.05), UNCERTAIN 0.35, MIN_AREA_PX 400.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Classifying Piece Sides For Border First AI 技能有什么作用?

Types a jigsaw piece's four sides flat / tab / blank from a top-down mask and calls it a corner, edge or interior piece - the side lines are found as the direction (1 degree steps) whose projections pile the outline's points into the sharpest peak near each extreme (straight shoulders and flat sides), then each side's middle stretch is a tab where it reaches past its line by 12 % of the side, a blank where it falls behind it, flat otherwise. Returns the outward direction of each flat side (where the board's edge must lie), sides near the threshold as uncertain, and, for many pieces, the ids...

为什么在 TypingMind 中使用 Classifying Piece Sides For Border First?

因为您只需安装一次,就能搭配任何模型使用。Classifying Piece Sides For Border First 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Classifying Piece Sides For Border First?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/runtime-si/RoboSkillHub/tree/main/skills/classifying-piece-sides-for-border-first。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Classifying Piece Sides For Border First?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Classifying Piece Sides For Border First 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Classifying Piece Sides For Border First 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Classifying Piece Sides For Border First AI 技能免费吗?

是的。runtime-si 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇