heuristic backup for when learned model crashes during patch fill
Browse files- PBC3.py +3 -0
- static/app.js +4 -0
- static/index.html +1 -1
PBC3.py
CHANGED
|
@@ -645,6 +645,9 @@ class PBC3:
|
|
| 645 |
current_channel = cls._choose_channel(scores, step, channels, config.channel_cycle)
|
| 646 |
boxes = None if filler.learned is not None else search.propose(target, canvas, config, rng, step, current_channel, timings)
|
| 647 |
patch, values = filler.select(target, canvas, config, rng, channel_bits, step, current_channel, boxes, len(patches), debug_lines, timings)
|
|
|
|
|
|
|
|
|
|
| 648 |
if patch is None:
|
| 649 |
break
|
| 650 |
t = time.perf_counter(); c = patch["channel"]
|
|
|
|
| 645 |
current_channel = cls._choose_channel(scores, step, channels, config.channel_cycle)
|
| 646 |
boxes = None if filler.learned is not None else search.propose(target, canvas, config, rng, step, current_channel, timings)
|
| 647 |
patch, values = filler.select(target, canvas, config, rng, channel_bits, step, current_channel, boxes, len(patches), debug_lines, timings)
|
| 648 |
+
if patch is None and filler.learned is not None:
|
| 649 |
+
boxes = search.propose(target, canvas, config, rng, step, current_channel, timings)
|
| 650 |
+
patch, values = filler.select_heuristic(target, canvas, config, channel_bits, step, boxes, len(patches), debug_lines, timings)
|
| 651 |
if patch is None:
|
| 652 |
break
|
| 653 |
t = time.perf_counter(); c = patch["channel"]
|
static/app.js
CHANGED
|
@@ -453,6 +453,10 @@ document.querySelectorAll("#param-mode .seg-btn").forEach(b => b.addEventListene
|
|
| 453 |
document.querySelectorAll("#param-mode .seg-btn").forEach(x => x.classList.remove("active"));
|
| 454 |
b.classList.add("active");
|
| 455 |
paramMode = b.dataset.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 456 |
renderParams();
|
| 457 |
}));
|
| 458 |
|
|
|
|
| 453 |
document.querySelectorAll("#param-mode .seg-btn").forEach(x => x.classList.remove("active"));
|
| 454 |
b.classList.add("active");
|
| 455 |
paramMode = b.dataset.mode;
|
| 456 |
+
if (paramMode === "Auto") {
|
| 457 |
+
const preset = (paramState.preset && paramState.preset !== "custom") ? paramState.preset : "quality";
|
| 458 |
+
applyPreset(preset);
|
| 459 |
+
}
|
| 460 |
renderParams();
|
| 461 |
}));
|
| 462 |
|
static/index.html
CHANGED
|
@@ -248,7 +248,7 @@
|
|
| 248 |
<div id="toast" class="toast"></div>
|
| 249 |
|
| 250 |
<script src="https://cdn.plot.ly/plotly-2.35.2.min.js" charset="utf-8"></script>
|
| 251 |
-
<script src="/app.js?v=
|
| 252 |
<script src="/viewer_magnifier.js?v=20260622b"></script>
|
| 253 |
<script src="/sweep.js?v=20260622b"></script>
|
| 254 |
<script src="/benchmark.js?v=20260624e"></script>
|
|
|
|
| 248 |
<div id="toast" class="toast"></div>
|
| 249 |
|
| 250 |
<script src="https://cdn.plot.ly/plotly-2.35.2.min.js" charset="utf-8"></script>
|
| 251 |
+
<script src="/app.js?v=20260625a"></script>
|
| 252 |
<script src="/viewer_magnifier.js?v=20260622b"></script>
|
| 253 |
<script src="/sweep.js?v=20260622b"></script>
|
| 254 |
<script src="/benchmark.js?v=20260624e"></script>
|