Repository navigation
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)
LatestUpgrading 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-platefinds 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-platenow readsprop_plate.rgbalong withprop_plate.boxfrom the canvas report (refusing a report withoutrgbbefore anything is keyed withvideo-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,findlocates the side and top: pixels that are a shade of the plate's colour, meaning the plate's colour times a least-squares brightnessk(pixel dot colour over colour dot colour) between 0.4 (SHADE_LEAST) and 1, with each channel withink * 48ofktimes 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_pxis 0 in every frame of the synthetic clips without a side); a sliver of side the subject hides all but less thanPIECE_SHAREof (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 reportedboxspans the front and the side and top (seeding the next frame's search window), whiletiltis measured on the front alone. Erasure and--decontampalette 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-plateprints 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 printsvideo-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_plateaddsside_touching(the frames withside_touch_pxabove 0), and each found row inrowsaddsside_px(pixels of the side and top found joined to the front;plate_pxstays the front's) andside_touch_px(opaque pixels that stay within 4 px of the side and top). - Python callers:
sprite_gen.video.prop_plate: newshade(rgb, colour)andSHADE_LEAST(0.4);read(report)returnsrgbtoo and refuses a report without it;findrows gainside_px;region(row, size, part="pixels")gainspart("sides": the reach round the side and top alone);erasereportsside_touchingand rowsside_touch_px;warningsadds the third line. - Docs: video-pipeline.md "Prop plate:
--prop-plate" subsection and canvas paragraph,SKILL.mdplate paragraph, and the module docstring ofsprite_gen/video/prop_plate.py. - Tests:
tests/video/test_prop_plate.py(28 synthetic tests, up from 19 in 4.2.0). Adds theboxedclip: 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'sside_pxbetween 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), andplate_pxwithin 5% of the drawn front where the figure is clear of it;side_touchingnaming 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 theboxedclip 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_LEASTat 0 or 0.3 reads black or too dark a colour as a shade (1 fails); a tolerance not darkened withkfails 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.