Logo: Classifying Piece Sides For Border First

Classifying Piece Sides For Border First

Organisatioun
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.

Iwwersiicht

Editeurruntime-si
RepositoryRoboSkillHub
Skill-Nummclassifying-piece-sides-for-border-first
Stären
242
Forks
27
Matgeliwwert Dateien
2
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    runtime-si huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Classifying Piece Sides For Border First an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/runtime-si/RoboSkillHub/tree/main/skills/classifying-piece-sides-for-border-first
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Classifying Piece Sides For Border First an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Classifying Piece Sides For Border First automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Classifying Piece Sides For Border First net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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...

Firwat Classifying Piece Sides For Border First op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Classifying Piece Sides For Border First besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Classifying Piece Sides For Border First an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/runtime-si/RoboSkillHub/tree/main/skills/classifying-piece-sides-for-border-first an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Classifying Piece Sides For Border First benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Classifying Piece Sides For Border First benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Classifying Piece Sides For Border First domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Classifying Piece Sides For Border First gratis?

Jo. runtime-si huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇