Clean phase-field release seams
This commit is contained in:
parent
ea139e5f0a
commit
68a45359f9
6 changed files with 48 additions and 15 deletions
|
|
@ -151,7 +151,7 @@ def summarize_run(result: RunResult) -> dict[str, Any]:
|
|||
height=result.source_rgba.shape[0],
|
||||
)
|
||||
source_fidelity = {
|
||||
"snap_initial": source_lattice_consistency_breakdown(
|
||||
"initial_output": source_lattice_consistency_breakdown(
|
||||
result.source_rgba,
|
||||
result.solver.initial_rgba,
|
||||
target_width=result.inference.target_width,
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class SolverHyperParams:
|
|||
phase_field_magnitude_weight: float = 0.08
|
||||
phase_field_learning_rate: float = 0.10
|
||||
phase_field_max_displacement_ratio: float = 0.48
|
||||
phase_rerank_preview_steps: int = 8
|
||||
source_edge_detail_threshold: float = 0.25
|
||||
alpha_opaque_threshold: float = 0.95
|
||||
alpha_transparent_threshold: float = 0.05
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ def run_pipeline(
|
|||
source,
|
||||
inference,
|
||||
analysis=analysis,
|
||||
steps=steps,
|
||||
seed=seed,
|
||||
device=device,
|
||||
solver_params=solver_params,
|
||||
|
|
@ -201,6 +202,7 @@ def _select_phase_candidate(
|
|||
inference: InferenceResult,
|
||||
*,
|
||||
analysis,
|
||||
steps: int = 0,
|
||||
seed: int,
|
||||
device: str,
|
||||
solver_params: SolverHyperParams | None = None,
|
||||
|
|
@ -211,6 +213,7 @@ def _select_phase_candidate(
|
|||
source,
|
||||
inference,
|
||||
analysis=analysis,
|
||||
steps=steps,
|
||||
seed=seed,
|
||||
device=device,
|
||||
solver_params=solver_params,
|
||||
|
|
@ -224,6 +227,7 @@ def _select_phase_candidate_with_reconstruction(
|
|||
inference: InferenceResult,
|
||||
*,
|
||||
analysis,
|
||||
steps: int = 0,
|
||||
seed: int,
|
||||
device: str,
|
||||
solver_params: SolverHyperParams | None = None,
|
||||
|
|
@ -238,6 +242,7 @@ def _select_phase_candidate_with_reconstruction(
|
|||
if len(inference.top_candidates) <= 1 or inference.confidence >= solver_params.phase_rerank_confidence_threshold:
|
||||
return inference
|
||||
|
||||
preview_steps = min(max(0, int(steps)), max(0, int(solver_params.phase_rerank_preview_steps)))
|
||||
top_score = float(inference.top_candidates[0].score)
|
||||
candidate_records: list[dict[str, float | InferenceResult]] = []
|
||||
for candidate in inference.top_candidates[:8]:
|
||||
|
|
@ -253,7 +258,7 @@ def _select_phase_candidate_with_reconstruction(
|
|||
source,
|
||||
inference=candidate_inference,
|
||||
analysis=analysis,
|
||||
steps=0,
|
||||
steps=preview_steps,
|
||||
seed=seed,
|
||||
device=device,
|
||||
solver_params=solver_params,
|
||||
|
|
|
|||
Loading…
Reference in a new issue