Split tile-graph off shared prep spine
This commit is contained in:
parent
cd09307367
commit
b3a2d72cc1
14 changed files with 389 additions and 301 deletions
|
|
@ -2,33 +2,28 @@ from __future__ import annotations
|
|||
|
||||
import numpy as np
|
||||
|
||||
from repixelizer.analysis import analyze_source
|
||||
from repixelizer.analysis import analyze_continuous_source, analyze_tile_graph_source
|
||||
|
||||
|
||||
def test_analyze_source_cpu_device_matches_default_path() -> None:
|
||||
def test_continuous_source_analysis_cpu_device_matches_default_path() -> None:
|
||||
source = np.zeros((8, 8, 4), dtype=np.float32)
|
||||
source[..., 3] = 1.0
|
||||
source[2:6, 3:5, :3] = np.asarray([1.0, 0.8, 0.2], dtype=np.float32)
|
||||
|
||||
default = analyze_source(source, seed=7)
|
||||
accelerated = analyze_source(source, seed=7, device="cpu")
|
||||
default = analyze_continuous_source(source, seed=7)
|
||||
accelerated = analyze_continuous_source(source, seed=7, device="cpu")
|
||||
|
||||
assert np.allclose(accelerated.edge_map, default.edge_map, atol=1e-5)
|
||||
assert accelerated.cluster_centers.shape == default.cluster_centers.shape
|
||||
assert np.allclose(accelerated.alpha_map, default.alpha_map, atol=1e-5)
|
||||
assert accelerated.cluster_map.shape == default.cluster_map.shape
|
||||
assert accelerated.cluster_preview.shape == default.cluster_preview.shape
|
||||
assert np.array_equal(accelerated.cluster_map, default.cluster_map)
|
||||
|
||||
|
||||
def test_analyze_source_can_skip_cluster_analysis() -> None:
|
||||
def test_tile_graph_source_analysis_is_edge_only() -> None:
|
||||
source = np.zeros((8, 8, 4), dtype=np.float32)
|
||||
source[..., 3] = 1.0
|
||||
source[2:6, 3:5, :3] = np.asarray([1.0, 0.8, 0.2], dtype=np.float32)
|
||||
|
||||
analysis = analyze_source(source, seed=7, device="cpu", include_clusters=False)
|
||||
analysis = analyze_tile_graph_source(source, device="cpu")
|
||||
|
||||
assert analysis.edge_map.shape == source.shape[:2]
|
||||
assert np.allclose(analysis.alpha_map, source[..., 3], atol=1e-5)
|
||||
assert analysis.cluster_centers.size == 0
|
||||
assert np.all(analysis.cluster_map == -1)
|
||||
assert np.count_nonzero(analysis.cluster_preview) == 0
|
||||
assert not hasattr(analysis, "cluster_map")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
import numpy as np
|
||||
import torch
|
||||
|
||||
from repixelizer.analysis import analyze_source
|
||||
from repixelizer.analysis import analyze_continuous_source
|
||||
from repixelizer.continuous import (
|
||||
_build_candidate_positions,
|
||||
_build_source_reliability,
|
||||
|
|
@ -62,7 +62,7 @@ def test_source_reliability_stays_high_for_high_contrast_edge_cells() -> None:
|
|||
source[..., 3] = 1.0
|
||||
source[:, 1, :3] = 1.0
|
||||
|
||||
analysis = analyze_source(source, seed=3)
|
||||
analysis = analyze_continuous_source(source, seed=3)
|
||||
reference = build_source_lattice_reference(
|
||||
source,
|
||||
target_width=4,
|
||||
|
|
@ -154,7 +154,7 @@ def test_optimize_uv_field_does_not_regress_from_snap_on_thin_feature_case() ->
|
|||
artifacts = optimize_uv_field(
|
||||
fake,
|
||||
inference=inference,
|
||||
analysis=analyze_source(fake, seed=7),
|
||||
analysis=analyze_continuous_source(fake, seed=7),
|
||||
steps=4,
|
||||
seed=7,
|
||||
device="cpu",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
||||
from repixelizer.analysis import analyze_source
|
||||
from repixelizer.analysis import analyze_continuous_source
|
||||
from repixelizer.baselines import naive_resize_baseline
|
||||
from repixelizer.continuous import optimize_uv_field
|
||||
from repixelizer.metrics import coherence_breakdown, foreground_reconstruction_error, source_lattice_consistency_breakdown
|
||||
|
|
@ -121,6 +122,76 @@ def test_pipeline_can_emit_initialized_output_without_optimizer_steps(tmp_path:
|
|||
assert result.output_rgba.shape[1] == result.inference.target_width
|
||||
|
||||
|
||||
def test_fixed_tile_graph_pipeline_output_matches_refactor_baseline(tmp_path: Path) -> None:
|
||||
source = make_emblem(24, 24)
|
||||
fake = fake_pixelize(
|
||||
source,
|
||||
upscale=8,
|
||||
phase_x=0.1,
|
||||
phase_y=-0.05,
|
||||
blur_radius=0.4,
|
||||
warp_strength=0.15,
|
||||
warp_detail=4,
|
||||
seed=9,
|
||||
)
|
||||
input_path = tmp_path / "tile-baseline-input.png"
|
||||
output_path = tmp_path / "tile-baseline-output.png"
|
||||
|
||||
from repixelizer.io import save_rgba
|
||||
|
||||
save_rgba(input_path, fake)
|
||||
result = run_pipeline(
|
||||
input_path,
|
||||
output_path,
|
||||
reconstruction_mode="tile-graph",
|
||||
target_width=24,
|
||||
target_height=24,
|
||||
phase_x=0.1,
|
||||
phase_y=-0.05,
|
||||
enable_phase_rerank=False,
|
||||
steps=0,
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
output_hash = hashlib.sha256(np.ascontiguousarray(result.output_rgba).view(np.uint8)).hexdigest()
|
||||
assert output_hash == "31e3bc2cbb802a8d11bf00fbeb73772f7fa4934e5f187888d6f0d5b356f36ae9"
|
||||
|
||||
|
||||
def test_fixed_continuous_pipeline_output_matches_refactor_baseline(tmp_path: Path) -> None:
|
||||
source = make_emblem(24, 24)
|
||||
fake = fake_pixelize(
|
||||
source,
|
||||
upscale=8,
|
||||
phase_x=0.1,
|
||||
phase_y=-0.05,
|
||||
blur_radius=0.4,
|
||||
warp_strength=0.15,
|
||||
warp_detail=4,
|
||||
seed=9,
|
||||
)
|
||||
input_path = tmp_path / "continuous-baseline-input.png"
|
||||
output_path = tmp_path / "continuous-baseline-output.png"
|
||||
|
||||
from repixelizer.io import save_rgba
|
||||
|
||||
save_rgba(input_path, fake)
|
||||
result = run_pipeline(
|
||||
input_path,
|
||||
output_path,
|
||||
reconstruction_mode="continuous",
|
||||
target_width=24,
|
||||
target_height=24,
|
||||
phase_x=0.1,
|
||||
phase_y=-0.05,
|
||||
enable_phase_rerank=False,
|
||||
steps=0,
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
output_hash = hashlib.sha256(np.ascontiguousarray(result.output_rgba).view(np.uint8)).hexdigest()
|
||||
assert output_hash == "404748af3c7241a6602cb91fdfed1fd7e116dd14098827e33e78c7da5e3d7903"
|
||||
|
||||
|
||||
def test_phase_rerank_can_override_low_confidence_inference_pick(monkeypatch) -> None:
|
||||
source = np.zeros((2, 2, 4), dtype=np.float32)
|
||||
source[0, 0] = np.asarray([1.0, 0.0, 0.0, 1.0], dtype=np.float32)
|
||||
|
|
@ -302,7 +373,7 @@ def test_pipeline_runs_tile_graph_once_without_phase_probe_reuse(tmp_path: Path,
|
|||
)
|
||||
|
||||
class DummyAnalysis:
|
||||
cluster_preview = np.zeros((6, 6, 4), dtype=np.float32)
|
||||
edge_map = np.zeros((6, 6), dtype=np.float32)
|
||||
|
||||
call_count = {"tile_graph": 0}
|
||||
|
||||
|
|
@ -336,7 +407,7 @@ def test_pipeline_runs_tile_graph_once_without_phase_probe_reuse(tmp_path: Path,
|
|||
return {"score": 0.05 if target_width == 3 else 0.15}
|
||||
|
||||
monkeypatch.setattr("repixelizer.pipeline.infer_lattice", lambda *args, **kwargs: inference)
|
||||
monkeypatch.setattr("repixelizer.pipeline.analyze_source", lambda *args, **kwargs: DummyAnalysis())
|
||||
monkeypatch.setattr("repixelizer.pipeline.analyze_tile_graph_source", lambda *args, **kwargs: DummyAnalysis())
|
||||
monkeypatch.setattr("repixelizer.pipeline.optimize_tile_graph", fake_optimize_tile_graph)
|
||||
monkeypatch.setattr("repixelizer.pipeline.source_lattice_consistency_breakdown", fake_support)
|
||||
monkeypatch.setattr("repixelizer.pipeline.foreground_edge_position_error", lambda *args, **kwargs: 0.1)
|
||||
|
|
@ -377,7 +448,8 @@ def test_pipeline_fixed_target_and_phase_skip_search_inference(tmp_path: Path, m
|
|||
)
|
||||
|
||||
class DummyAnalysis:
|
||||
cluster_preview = np.zeros((6, 6, 4), dtype=np.float32)
|
||||
edge_map = np.zeros((6, 6), dtype=np.float32)
|
||||
cluster_map = np.zeros((6, 6), dtype=np.int32)
|
||||
|
||||
def fail_infer(*args, **kwargs):
|
||||
raise AssertionError("full lattice search should not run for fixed target/phase")
|
||||
|
|
@ -398,7 +470,7 @@ def test_pipeline_fixed_target_and_phase_skip_search_inference(tmp_path: Path, m
|
|||
|
||||
monkeypatch.setattr("repixelizer.pipeline.infer_lattice", fail_infer)
|
||||
monkeypatch.setattr("repixelizer.pipeline.infer_fixed_lattice", fake_infer_fixed)
|
||||
monkeypatch.setattr("repixelizer.pipeline.analyze_source", lambda *args, **kwargs: DummyAnalysis())
|
||||
monkeypatch.setattr("repixelizer.pipeline.analyze_continuous_source", lambda *args, **kwargs: DummyAnalysis())
|
||||
monkeypatch.setattr("repixelizer.pipeline.optimize_uv_field", fake_optimize_uv_field)
|
||||
|
||||
result = run_pipeline(
|
||||
|
|
@ -551,7 +623,7 @@ def test_badge_fixture_candidate_beats_previous_source_fidelity_baselines() -> N
|
|||
artifacts = optimize_uv_field(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_source(source, seed=7),
|
||||
analysis=analyze_continuous_source(source, seed=7),
|
||||
steps=2,
|
||||
seed=7,
|
||||
device="cpu",
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@ from __future__ import annotations
|
|||
|
||||
import numpy as np
|
||||
|
||||
from repixelizer.io import premultiply
|
||||
from repixelizer.source_reference import build_source_lattice_reference
|
||||
from repixelizer.source_reference import build_source_lattice_reference, build_tile_graph_source_reference
|
||||
|
||||
|
||||
def test_source_lattice_reference_recovers_stable_cell_colors_and_deltas() -> None:
|
||||
def test_source_lattice_reference_recovers_stable_cell_colors() -> None:
|
||||
lowres = np.asarray(
|
||||
[
|
||||
[[1.0, 0.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0]],
|
||||
|
|
@ -25,15 +24,8 @@ def test_source_lattice_reference_recovers_stable_cell_colors_and_deltas() -> No
|
|||
phase_y=0.0,
|
||||
)
|
||||
|
||||
expected_premul = premultiply(lowres)
|
||||
assert np.allclose(reference.sharp_rgba, lowres, atol=1e-5)
|
||||
assert np.allclose(reference.mean_rgba[0, 1], lowres[0, 1], atol=1e-5)
|
||||
assert reference.delta_x is not None
|
||||
assert reference.delta_y is not None
|
||||
assert reference.delta_diag is not None
|
||||
assert reference.delta_anti is not None
|
||||
assert np.allclose(reference.delta_x, expected_premul[:, 1:, :] - expected_premul[:, :-1, :], atol=1e-5)
|
||||
assert np.allclose(reference.delta_y, expected_premul[1:, :, :] - expected_premul[:-1, :, :], atol=1e-5)
|
||||
assert reference.dispersion >= 0.0
|
||||
|
||||
|
||||
|
|
@ -63,12 +55,21 @@ def test_source_lattice_reference_tracks_edge_peaks_and_gradients() -> None:
|
|||
assert np.all(reference.edge_strength[:, 0] == 1.0)
|
||||
assert np.all(reference.edge_grad_x[:, 0] == 1.0)
|
||||
assert np.all(reference.edge_grad_y[:, 0] == 0.0)
|
||||
def test_source_lattice_reference_computes_default_edge_metadata() -> None:
|
||||
|
||||
|
||||
def test_tile_graph_source_reference_matches_continuous_anchor_fields() -> None:
|
||||
source = np.zeros((6, 6, 4), dtype=np.float32)
|
||||
source[..., 3] = 1.0
|
||||
source[:, 2, :3] = 1.0
|
||||
|
||||
reference = build_source_lattice_reference(
|
||||
full = build_source_lattice_reference(
|
||||
source,
|
||||
target_width=2,
|
||||
target_height=2,
|
||||
phase_x=0.0,
|
||||
phase_y=0.0,
|
||||
)
|
||||
tile = build_tile_graph_source_reference(
|
||||
source,
|
||||
target_width=2,
|
||||
target_height=2,
|
||||
|
|
@ -76,8 +77,12 @@ def test_source_lattice_reference_computes_default_edge_metadata() -> None:
|
|||
phase_y=0.0,
|
||||
)
|
||||
|
||||
assert np.all(reference.edge_strength[:, 0] > 0.0)
|
||||
assert np.all(reference.edge_peak_x[:, 0] == 2)
|
||||
assert np.allclose(tile.sharp_rgba, full.sharp_rgba, atol=1e-5)
|
||||
assert np.array_equal(tile.sharp_x, full.sharp_x)
|
||||
assert np.array_equal(tile.sharp_y, full.sharp_y)
|
||||
assert np.array_equal(tile.edge_peak_x, full.edge_peak_x)
|
||||
assert np.array_equal(tile.edge_peak_y, full.edge_peak_y)
|
||||
assert np.allclose(tile.edge_strength, full.edge_strength, atol=1e-5)
|
||||
|
||||
|
||||
def test_source_lattice_reference_cpu_device_matches_default_path() -> None:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from pathlib import Path
|
|||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from repixelizer.analysis import analyze_source
|
||||
from repixelizer.analysis import analyze_tile_graph_source
|
||||
from repixelizer.baselines import naive_resize_baseline
|
||||
from repixelizer.io import save_rgba
|
||||
from repixelizer.metrics import source_lattice_consistency_breakdown
|
||||
|
|
@ -36,15 +36,20 @@ def test_tile_graph_model_extracts_candidates_and_adjacency_from_lattice_proposa
|
|||
top_candidates=[],
|
||||
)
|
||||
|
||||
model = build_tile_graph_model(source, inference=inference, analysis=analyze_source(source, seed=7), device="cpu")
|
||||
model, stats = build_tile_graph_model(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_tile_graph_source(source, device="cpu"),
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
assert model.candidate_rgba.shape[0] > 4
|
||||
choice_counts = np.diff(model.cell_candidate_offsets)
|
||||
assert choice_counts.shape[0] == inference.target_width * inference.target_height
|
||||
assert np.all(choice_counts >= 1)
|
||||
assert model.average_choices >= 1.0
|
||||
assert model.edge_density > 0.0
|
||||
assert model.model_device == "cpu"
|
||||
assert stats.average_choices >= 1.0
|
||||
assert stats.edge_density > 0.0
|
||||
assert stats.model_device == "cpu"
|
||||
|
||||
|
||||
def test_tile_graph_model_works_with_edge_only_analysis() -> None:
|
||||
|
|
@ -61,15 +66,15 @@ def test_tile_graph_model_works_with_edge_only_analysis() -> None:
|
|||
top_candidates=[],
|
||||
)
|
||||
|
||||
model = build_tile_graph_model(
|
||||
model, stats = build_tile_graph_model(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_source(source, seed=5, device="cpu", include_clusters=False),
|
||||
analysis=analyze_tile_graph_source(source, device="cpu"),
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
assert model.candidate_rgba.shape[0] > 0
|
||||
assert model.model_device == "cpu"
|
||||
assert stats.model_device == "cpu"
|
||||
|
||||
|
||||
def test_tile_graph_candidates_use_literal_source_pixel_colors() -> None:
|
||||
|
|
@ -93,10 +98,10 @@ def test_tile_graph_candidates_use_literal_source_pixel_colors() -> None:
|
|||
confidence=1.0,
|
||||
top_candidates=[],
|
||||
)
|
||||
model = build_tile_graph_model(
|
||||
model, _stats = build_tile_graph_model(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_source(source, seed=13),
|
||||
analysis=analyze_tile_graph_source(source),
|
||||
solver_params=SolverHyperParams(tile_graph_max_candidates=32, tile_graph_max_candidates_per_coord=2),
|
||||
)
|
||||
|
||||
|
|
@ -106,7 +111,7 @@ def test_tile_graph_candidates_use_literal_source_pixel_colors() -> None:
|
|||
assert candidate_colors.issubset(source_colors | {tuple(np.zeros(4, dtype=np.float32))})
|
||||
|
||||
|
||||
def test_tile_graph_candidates_are_scoped_to_their_output_coord() -> None:
|
||||
def test_tile_graph_candidate_buckets_are_contiguous_per_output_coord() -> None:
|
||||
source = np.zeros((8, 8, 4), dtype=np.float32)
|
||||
source[..., 3] = 1.0
|
||||
source[:, 2:4] = np.asarray([1.0, 0.9, 0.2, 1.0], dtype=np.float32)
|
||||
|
|
@ -120,20 +125,16 @@ def test_tile_graph_candidates_are_scoped_to_their_output_coord() -> None:
|
|||
top_candidates=[],
|
||||
)
|
||||
|
||||
model = build_tile_graph_model(
|
||||
model, _stats = build_tile_graph_model(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_source(source, seed=11),
|
||||
analysis=analyze_tile_graph_source(source),
|
||||
)
|
||||
|
||||
for y in range(inference.target_height):
|
||||
for x in range(inference.target_width):
|
||||
flat = y * inference.target_width + x
|
||||
start = int(model.cell_candidate_offsets[flat])
|
||||
end = int(model.cell_candidate_offsets[flat + 1])
|
||||
coords = model.candidate_coords[model.cell_candidate_indices[start:end]]
|
||||
assert np.all(coords[:, 0] == y)
|
||||
assert np.all(coords[:, 1] == x)
|
||||
total_candidates = int(model.candidate_rgba.shape[0])
|
||||
assert int(model.cell_candidate_offsets[0]) == 0
|
||||
assert int(model.cell_candidate_offsets[-1]) == total_candidates
|
||||
assert np.array_equal(model.cell_candidate_indices, np.arange(total_candidates, dtype=np.int32))
|
||||
|
||||
|
||||
def test_tile_graph_region_extraction_covers_every_occupied_output_cell() -> None:
|
||||
|
|
@ -157,7 +158,7 @@ def test_tile_graph_region_extraction_covers_every_occupied_output_cell() -> Non
|
|||
top_candidates=[],
|
||||
)
|
||||
params = SolverHyperParams()
|
||||
analysis = analyze_source(source, seed=7, device="cpu")
|
||||
analysis = analyze_tile_graph_source(source, device="cpu")
|
||||
cell_h = source.shape[0] / inference.target_height
|
||||
cell_w = source.shape[1] / inference.target_width
|
||||
source_region_stride = 2
|
||||
|
|
@ -236,10 +237,10 @@ def test_tile_graph_projects_source_regions_instead_of_mixed_lattice_buckets() -
|
|||
top_candidates=[],
|
||||
)
|
||||
|
||||
model = build_tile_graph_model(
|
||||
model, _stats = build_tile_graph_model(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_source(source, seed=19),
|
||||
analysis=analyze_tile_graph_source(source),
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
|
|
@ -280,10 +281,10 @@ def test_tile_graph_edge_cells_include_multiple_same_cell_contour_colors() -> No
|
|||
confidence=1.0,
|
||||
top_candidates=[],
|
||||
)
|
||||
model = build_tile_graph_model(
|
||||
model, _stats = build_tile_graph_model(
|
||||
source,
|
||||
inference=inference,
|
||||
analysis=analyze_source(source, seed=17),
|
||||
analysis=analyze_tile_graph_source(source),
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
|
|
@ -329,7 +330,7 @@ def test_tile_graph_reconstructs_synthetic_thin_feature_better_than_naive() -> N
|
|||
artifacts, _ = optimize_tile_graph(
|
||||
fake,
|
||||
inference=inference,
|
||||
analysis=analyze_source(fake, seed=7),
|
||||
analysis=analyze_tile_graph_source(fake),
|
||||
steps=0,
|
||||
seed=7,
|
||||
device="cpu",
|
||||
|
|
@ -384,7 +385,7 @@ def test_tile_graph_keeps_shallow_connected_stroke_from_fanning_out() -> None:
|
|||
confidence=1.0,
|
||||
top_candidates=[],
|
||||
),
|
||||
analysis=analyze_source(source, seed=7),
|
||||
analysis=analyze_tile_graph_source(source),
|
||||
steps=0,
|
||||
seed=7,
|
||||
device="cpu",
|
||||
|
|
@ -423,7 +424,7 @@ def test_tile_graph_preserves_transparent_background_on_sparse_detail() -> None:
|
|||
confidence=1.0,
|
||||
top_candidates=[],
|
||||
),
|
||||
analysis=analyze_source(fake, seed=7),
|
||||
analysis=analyze_tile_graph_source(fake),
|
||||
steps=0,
|
||||
seed=7,
|
||||
device="cpu",
|
||||
|
|
@ -449,8 +450,8 @@ def test_tile_graph_cuda_matches_cpu_on_small_case() -> None:
|
|||
confidence=1.0,
|
||||
top_candidates=[],
|
||||
)
|
||||
cpu_analysis = analyze_source(fake, seed=7, device="cpu")
|
||||
cuda_analysis = analyze_source(fake, seed=7, device="cuda")
|
||||
cpu_analysis = analyze_tile_graph_source(fake, device="cpu")
|
||||
cuda_analysis = analyze_tile_graph_source(fake, device="cuda")
|
||||
|
||||
cpu_artifacts, cpu_diag = optimize_tile_graph(
|
||||
fake,
|
||||
|
|
@ -488,23 +489,23 @@ def test_tile_graph_model_cache_reuses_fixed_lattice_build() -> None:
|
|||
confidence=1.0,
|
||||
top_candidates=[],
|
||||
)
|
||||
analysis = analyze_source(fake, seed=7, device="cpu")
|
||||
analysis = analyze_tile_graph_source(fake, device="cpu")
|
||||
|
||||
first = build_tile_graph_model(
|
||||
first, first_stats = build_tile_graph_model(
|
||||
fake,
|
||||
inference=inference,
|
||||
analysis=analysis,
|
||||
device="cpu",
|
||||
)
|
||||
second = build_tile_graph_model(
|
||||
second, second_stats = build_tile_graph_model(
|
||||
fake,
|
||||
inference=inference,
|
||||
analysis=analysis,
|
||||
device="cpu",
|
||||
)
|
||||
|
||||
assert first.cache_hit is False
|
||||
assert second.cache_hit is True
|
||||
assert first_stats.cache_hit is False
|
||||
assert second_stats.cache_hit is True
|
||||
assert np.array_equal(first.candidate_rgba, second.candidate_rgba)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue