Skip to content

v4.3.0 - Shaded sides and tops on the prop plate found as shades of prop_plate.rgb and erased with their edge lines, palette exclusion, and side contact warning (video-frames --prop-plate)

Latest

Choose a tag to compare

@aldegad aldegad released this 07 Nov 17:41
· 57 commits to main since this release

Upgrading from 4.2.0: runs without --prop-plate give the same files, frames reports, stdout, and stderr byte for byte as 4.2.0, except the engine fingerprint implementation_sha256 (in producer of the loop report and other reports that carry one, and in measurement_engine and receipt_engine fields), which hashes every file in sprite_gen/video (only sprite_gen/video/prop_plate.py changed, and video-frames reaches it only with --prop-plate). Runs with --prop-plate now also find and erase shaded sides and tops a video model draws on the plate, erase pale green codec ringing and dark reddened box-edge lines within 4 px of what the plate's pixels and the colour rules took, exclude the side and top and their 4 px rim from --decontam palette learning, add side_px and side_touch_px to each frame row and side_touching to the frames report's prop_plate, print a third warning line when the plate's shaded side or top meets the subject, and refuse a canvas report without prop_plate.rgb before keying (video-canvas --prop-plate has always written it). video-canvas --prop-plate is unchanged. No new dependency, no model call.

  • Fix: video-frames --prop-plate finds and erases shaded box sides and tops drawn on the plate, using the plate colour from the canvas report. With the camera following the body, a video model can draw the flat plate as a box with thickness: a shaded side beside its front and a top above it in darker shades of the plate's colour. 4.2.0 matched only the bright front (pixels within 48 of the plate's colour on every channel), leaving any side wider than the 4 px rim in keyed frames and every cut from them as a vertical band of dark magenta, or a grey line where the side was thin. video-frames --prop-plate now reads prop_plate.rgb along with prop_plate.box from the canvas report (refusing a report without rgb before anything is keyed with video-frames: --prop-plate: <path> holds no plate colour (prop_plate.rgb); make the canvas again with video-canvas --prop-plate) and finds the front, the side and top, and the light span of the blend line by that one colour. In each frame, after the front is found as before, find locates the side and top: pixels that are a shade of the plate's colour, meaning the plate's colour times a least-squares brightness k (pixel dot colour over colour dot colour) between 0.4 (SHADE_LEAST) and 1, with each channel within k * 48 of k times the colour so the tolerance darkens with the colour. They count only when joined to the front side by side or at corners (directly or through other shades), and only in pieces of shades holding at least 1% of the plate's area on the frame each (PIECE_SHARE, the same floor as the front's pieces). What is not read as a side: a shade the subject holds apart from the plate; dark magenta codec mixing where the subject's outline crosses the plate (too thin a piece; side_px is 0 in every frame of the synthetic clips without a side); a sliver of side the subject hides all but less than PIECE_SHARE of (the 4 px rim takes that sliver); black and the plate's colour at 0.35 of its light (at 0.4 it is a shade); and skin tones (of eight skin tones tested, mixed with the plate's colour as a codec blends an edge, the darkest (92, 51, 23) is read as a shade only from 0.47 of the plate's colour and a light one (238, 206, 178) from 0.78). Each frame's reported box spans the front and the side and top (seeding the next frame's search window), while tilt is measured on the front alone. Erasure and --decontam palette exclusion now cover the front, side, and top and the 4 px rim around them.
  • Fix: the third erasure rule measures its 4 px reach from what the plate's pixels and the colour rules took. In 4.1.0 and 4.2.0, opaque pieces remaining after the magenta and blend-line rules were erased only when they lay wholly within 4 px of the plate's pixels. They now go when they lie in a piece (opaque pixels joined side by side or at corners) wholly within 4 px of what the plate's pixels (front, side, and top) and the two colour rules took. This erases a box's far edge drawn darker and redder than any shade along with the grey line beyond it, and the pale green a codec rings just past the line the plate's edge blends into the key with, while keeping the subject reaching past that 4 px reach (with the rest of the line where its pixels touch it).
  • New: --prop-plate prints a third warning line when the plate's shaded side or top meets the subject. When opaque pixels stay within 4 px of the side and top (side_touch_px > 0), a run prints video-frames: warning: --prop-plate: the plate's shaded side or top meets the subject in N frame(s) (...): they went with the plate, and within 4 px of them the subject's pixels stay but for those tinted magenta; look at the subject's edge there, naming the first six frames and counting the rest.
  • The frames report's prop_plate adds side_touching (the frames with side_touch_px above 0), and each found row in rows adds side_px (pixels of the side and top found joined to the front; plate_px stays the front's) and side_touch_px (opaque pixels that stay within 4 px of the side and top).
  • Python callers: sprite_gen.video.prop_plate: new shade(rgb, colour) and SHADE_LEAST (0.4); read(report) returns rgb too and refuses a report without it; find rows gain side_px; region(row, size, part="pixels") gains part ("sides": the reach round the side and top alone); erase reports side_touching and rows side_touch_px; warnings adds the third line.
  • Docs: video-pipeline.md "Prop plate: --prop-plate" subsection and canvas paragraph, SKILL.md plate paragraph, and the module docstring of sprite_gen/video/prop_plate.py.
  • Tests: tests/video/test_prop_plate.py (28 synthetic tests, up from 19 in 4.2.0). Adds the boxed clip: the camera pans 4 px a frame, from its fifth frame the plate is drawn as a box with a shaded side (178, 0, 166) and a top (200, 0, 196) a pixel wider each frame up to 10 px and a dark line along the side's far edge, and in its eighth frame the figure rests a hand on the plate's top by its side. Checks: no pixel of the plate, its side or top, or the line round them, and no magenta, in any keyed frame of the three clips (filmed, panned, boxed); each row's side_px between the drawn side and top shrunk and grown by 1 px (none before the side is drawn, none in the two clips without a side), and plate_px within 5% of the drawn front where the figure is clear of it; side_touching naming the frames the figure meets the side or top in, the hand's among them, but not one where the figure hides all of them but a sliver below the piece floor; the third warning line; skin-to-shade distance across eight skin tones (pinning at least 0.45 for the darkest (92, 51, 23), actual 0.47, and at least 0.75 for a light one (238, 206, 178), actual 0.78; black and 0.35 of the plate's light rejected, 0.4 accepted); a direct picture of a box (a 10 px side, a top, the dark edge line, and its grey) where all of it goes and a patch of the side's own colour 12 px past the side stays; the plate found by the report's colour (told blue, no frame finds it) and a report without a colour refused; a direct picture where a 2 px pale green past the left edge line and a thin side reddening toward the key go while a denim bar under the plate keeps every pixel; the figure, its hand included, losing only edge pixels the codec tinted magenta (at most 2 a frame inside its core; in the hand frame 12 of the arm's 942 pixels go against 9 in 4.2.0, none of its core); and the frames away from each frame's plate byte-identical to the frames keyed without --prop-plate. Red first on 4.2.0: 7 of the 28 fail, and the boxed clip keeps plate pixels in 7 of its 16 frames (175, 189, 370, 572, 738, 738, and 738 px, up to 540 of them magenta). Each new rule undone fails a test: no piece floor for the side's pieces reads false sides in the clips without one (2 fail); shades read without being joined to the front erase the apart patch (1 fails); SHADE_LEAST at 0 or 0.3 reads black or too dark a colour as a shade (1 fails); a tolerance not darkened with k fails the skin to shade test and the reddened side test, at its find check (2 fail); and the third rule measured from the plate's pixels alone, as in 4.2.0, leaves the pale green and the reddened side in columns 34 to 37 and 58 to 61 (1 fails).

Install or update:

pip install --upgrade "sprite-gen @ git+https://github.com/aldegad/sprite-gen.git@v4.3.0"

The wheel, the source archive and SHA256SUMS are attached. Full notes in CHANGELOG.md.