commit 8989ee5dbfaf6a44a46b489ad5424fc01fed15b5
parent 1b22d96be8261422064dfa3baf5fdf1849ceb7d7
Author: vossen <44332958+vossenv@users.noreply.github.com>
Date: Thu, 20 Apr 2023 22:48:49 -0500
Change button info string to be more helpful, add digit to ESR (#174)
Change button info string to be more helpful, add digit to ESR
Diffstat:
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/nam/train/core.py b/nam/train/core.py
@@ -338,13 +338,13 @@ def _plot(
esr_comment = "...This probably won't sound great :("
else:
esr_comment = "...Something seems to have gone wrong."
- print(f"Error-signal ratio = {esr:.3f}")
+ print(f"Error-signal ratio = {esr:.4f}")
print(esr_comment)
plt.figure(figsize=(16, 5))
plt.plot(output[window_start:window_end], label="Prediction")
plt.plot(ds.y[window_start:window_end], linestyle="--", label="Target")
- plt.title(f"ESR={esr:.3f}")
+ plt.title(f"ESR={esr:.4f}")
plt.legend()
if filepath is not None:
plt.savefig(filepath + ".png")
diff --git a/nam/train/gui.py b/nam/train/gui.py
@@ -10,6 +10,7 @@ Usage:
>>> run()
"""
+
# Hack to recover graceful shutdowns in Windows.
# This has to happen ASAP
# See:
@@ -68,11 +69,12 @@ class _PathButton(object):
def __init__(
self,
frame: tk.Frame,
- button_text,
+ button_text: str,
info_str: str,
path_type: _PathType,
hooks: Optional[Sequence[Callable[[], None]]] = None,
):
+ self._button_text = button_text
self._info_str = info_str
self._path: Optional[Path] = None
self._path_type = path_type
@@ -104,12 +106,12 @@ class _PathButton(object):
def _set_text(self):
if self._path is None:
self._label["fg"] = "red"
- self._label["text"] = f"{self._info_str} is not set!"
+ self._label["text"] = self._info_str
else:
val = self.val
val = val[0] if isinstance(val, tuple) and len(val) == 1 else val
self._label["fg"] = "black"
- self._label["text"] = f"{self._info_str} set to {val}"
+ self._label["text"] = f"{self._button_text.capitalize()} set to {val}"
def _set_val(self):
res = {
@@ -137,7 +139,7 @@ class _GUI(object):
self._path_button_input = _PathButton(
self._frame_input_path,
"Input Audio",
- "Input audio",
+ "Select input DI file (eg: v1_1_1.wav)",
_PathType.FILE,
hooks=[self._check_button_states],
)
@@ -147,7 +149,7 @@ class _GUI(object):
self._path_button_output = _PathButton(
self._frame_output_path,
"Output Audio",
- "Output audio",
+ "Select output (reamped) audio - choose multiple files to enable batch training",
_PathType.MULTIFILE,
hooks=[self._check_button_states],
)
@@ -157,7 +159,7 @@ class _GUI(object):
self._path_button_train_destination = _PathButton(
self._frame_train_destination,
"Train Destination",
- "Train destination",
+ "Select training output directory",
_PathType.DIRECTORY,
hooks=[self._check_button_states],
)
@@ -207,7 +209,7 @@ class _GUI(object):
self._silent = tk.BooleanVar()
self._chkbox_silent = tk.Checkbutton(
self._frame_silent,
- text="Silent run",
+ text="Silent run (suggested for batch training)",
variable=self._silent,
)
self._chkbox_silent.grid(row=1, column=1, sticky="W")
@@ -217,7 +219,7 @@ class _GUI(object):
self._save_plot.set(True) # default this to true
self._chkbox_save_plot = tk.Checkbutton(
self._frame_silent,
- text="Save plot automatically",
+ text="Save ESR plot automatically",
variable=self._save_plot,
)
self._chkbox_save_plot.grid(row=2, column=1, sticky="W")