Trim tile-graph to edge-only analysis
This commit is contained in:
parent
d33a68c310
commit
cd09307367
9 changed files with 104 additions and 82 deletions
|
|
@ -18,3 +18,17 @@ def test_analyze_source_cpu_device_matches_default_path() -> None:
|
|||
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
|
||||
|
||||
|
||||
def test_analyze_source_can_skip_cluster_analysis() -> 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)
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue