Remove dead bilinear_resize and lattice_source_rgba
REC-117: both functions had definitions but no imports, calls, tests, or doc references anywhere in the repo. Kill attempts that failed: none. - `rg -n -w 'bilinear_resize|lattice_source_rgba' src tests tools scripts README.md docs` -> only the two now-removed definitions (repeated the census command against current HEAD). - Cross-repo `rg -n -w 'bilinear_resize|lattice_source_rgba'` over all of F:/Projects -> only this repo's own source and the census docs. - Confirmed `build_source_lattice_reference`, which `lattice_source_rgba` called, is still used by two other live callers in metrics.py (lines 280, 311) and was left untouched. Checks run: `python -m py_compile src/repixelizer/io.py src/repixelizer/metrics.py` -> compiles cleanly. Did not run the pytest suite: this repo's runtime dependencies include torch>=2.6.0, which is not installed in this worktree and installing it would be a multi-GB download outside this pass's focused-check budget; no test file references either function by name (`rg -n -w 'bilinear_resize|lattice_source_rgba' tests` -> no matches), so this is a compile-level check only, stated plainly rather than reported as a full green test run. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
1e1a3441fe
commit
9e8c8f6b8d
2 changed files with 0 additions and 22 deletions
|
|
@ -41,12 +41,6 @@ def box_resize(rgba: np.ndarray, width: int, height: int) -> np.ndarray:
|
|||
return np.asarray(resized, dtype=np.float32) / 255.0
|
||||
|
||||
|
||||
def bilinear_resize(rgba: np.ndarray, width: int, height: int) -> np.ndarray:
|
||||
image = Image.fromarray(np.clip(np.rint(rgba * 255.0), 0, 255).astype(np.uint8), mode="RGBA")
|
||||
resized = image.resize((width, height), resample=Image.Resampling.BILINEAR)
|
||||
return np.asarray(resized, dtype=np.float32) / 255.0
|
||||
|
||||
|
||||
def lanczos_resize(rgba: np.ndarray, width: int, height: int) -> np.ndarray:
|
||||
image = Image.fromarray(np.clip(np.rint(rgba * 255.0), 0, 255).astype(np.uint8), mode="RGBA")
|
||||
resized = image.resize((width, height), resample=Image.Resampling.LANCZOS)
|
||||
|
|
|
|||
|
|
@ -496,19 +496,3 @@ def _motif_blocks(premul: np.ndarray) -> np.ndarray:
|
|||
centered = blocks - np.mean(blocks, axis=-2, keepdims=True)
|
||||
scale = np.maximum(1e-4, np.mean(np.abs(centered), axis=(-2, -1), keepdims=True))
|
||||
return centered / scale
|
||||
|
||||
|
||||
def lattice_source_rgba(
|
||||
source_rgba: np.ndarray,
|
||||
*,
|
||||
target_width: int,
|
||||
target_height: int,
|
||||
alpha_threshold: float = 0.05,
|
||||
) -> tuple[np.ndarray, float]:
|
||||
reference = build_source_lattice_reference(
|
||||
source_rgba,
|
||||
target_width=target_width,
|
||||
target_height=target_height,
|
||||
alpha_threshold=alpha_threshold,
|
||||
)
|
||||
return reference.mean_rgba, reference.dispersion
|
||||
|
|
|
|||
Loading…
Reference in a new issue