From b859249fdcee4941bc72506e41d6442ae5522794 Mon Sep 17 00:00:00 2001 From: sdata07 Date: Wed, 12 Aug 2026 19:59:41 -0400 Subject: [PATCH 1/3] Fixed command in the error message for template not found to the new version --- fenn/cli/pull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fenn/cli/pull.py b/fenn/cli/pull.py index df10678..e92707d 100644 --- a/fenn/cli/pull.py +++ b/fenn/cli/pull.py @@ -285,7 +285,7 @@ def _download_template(template_name: str, target_dir: Path, force: bool) -> Non if e.response.status_code == 404: # ty: ignore[unresolved-attribute] raise TemplateNotFoundError( f"Template {Fore.LIGHTYELLOW_EX}{template_name}{Fore.RED} not found. " - f"Use {Fore.LIGHTYELLOW_EX}fenn pull --list{Fore.RED} to see available templates, " + f"Use {Fore.LIGHTYELLOW_EX}fenn list{Fore.RED} to see available templates, " f"or visit {Fore.CYAN}https://github.com/{TEMPLATES_REPO}{Style.RESET_ALL}" ) raise NetworkError(f"Failed to check template existence: {e}") From a0d8f05a8983cc0d69d0a1765741c47b069b5258 Mon Sep 17 00:00:00 2001 From: sdata07 Date: Fri, 21 Aug 2026 12:14:25 -0400 Subject: [PATCH 2/3] fix: [#312] Changed instances of .max to np.max to fix typecheck issues --- fenn/experimental/vision/normalize.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fenn/experimental/vision/normalize.py b/fenn/experimental/vision/normalize.py index 3098972..fe0e059 100644 --- a/fenn/experimental/vision/normalize.py +++ b/fenn/experimental/vision/normalize.py @@ -106,7 +106,7 @@ def _normalize_0_1(array: np.ndarray) -> np.ndarray: normalized_alpha = alpha_channel / dtype_max else: # Float type: if > 1, assume [0, 255] range, else already normalized - if alpha_channel.max() > 1.0: + if np.max(alpha_channel) > 1.0: normalized_alpha = alpha_channel / 255.0 else: normalized_alpha = alpha_channel @@ -130,7 +130,7 @@ def _normalize_0_1(array: np.ndarray) -> np.ndarray: normalized_alpha = alpha_channel / dtype_max else: # Float type: if > 1, assume [0, 255] range, else already normalized - if alpha_channel.max() > 1.0: + if np.max(alpha_channel) > 1.0: normalized_alpha = alpha_channel / 255.0 else: normalized_alpha = alpha_channel @@ -198,7 +198,7 @@ def _normalize_minus1_1(array: np.ndarray) -> np.ndarray: normalized_alpha = 2.0 * (alpha_channel / dtype_max) - 1.0 else: # Float type: if > 1, assume [0, 255] range, else already in [0, 1] - if alpha_channel.max() > 1.0: + if np.max(alpha_channel) > 1.0: normalized_alpha = 2.0 * (alpha_channel / 255.0) - 1.0 else: # Already in [0, 1], map to [-1, 1] @@ -223,7 +223,7 @@ def _normalize_minus1_1(array: np.ndarray) -> np.ndarray: normalized_alpha = 2.0 * (alpha_channel / dtype_max) - 1.0 else: # Float type: if > 1, assume [0, 255] range, else already in [0, 1] - if alpha_channel.max() > 1.0: + if np.max(alpha_channel) > 1.0: normalized_alpha = 2.0 * (alpha_channel / 255.0) - 1.0 else: # Already in [0, 1], map to [-1, 1] @@ -290,8 +290,8 @@ def _normalize_imagenet_stats(array: np.ndarray) -> np.ndarray: alpha_channel_original = array_float[:, 3:4, ...].copy() # Auto-normalize only RGB channels to [0, 1] if needed - rgb_max = rgb_channels_float.max() - rgb_min = rgb_channels_float.min() + rgb_max = np.max(rgb_channels_float) + rgb_min = np.max(rgb_channels_float) if rgb_min < 0.0: if rgb_max <= 1.0: @@ -306,8 +306,8 @@ def _normalize_imagenet_stats(array: np.ndarray) -> np.ndarray: rgb_channels_float = rgb_channels_float / 255.0 else: # Auto-normalize entire array to [0, 1] if values are outside expected [0, 1] range - array_max = array_float.max() - array_min = array_float.min() + array_max = np.max(array_float) + array_min = np.min(array_float) if array_min < 0.0: # Values are < 0, likely in [-1, 1] range @@ -341,7 +341,7 @@ def _normalize_imagenet_stats(array: np.ndarray) -> np.ndarray: normalized_alpha = alpha_channel_original / dtype_max else: # Float type: if > 1, assume [0, 255] range, else already in [0, 1] - if alpha_channel_original.max() > 1.0: + if np.max(alpha_channel_original) > 1.0: normalized_alpha = alpha_channel_original / 255.0 else: # Already in [0, 1], preserve as-is @@ -359,7 +359,7 @@ def _normalize_imagenet_stats(array: np.ndarray) -> np.ndarray: normalized_alpha = alpha_channel_original / dtype_max else: # Float type: if > 1, assume [0, 255] range, else already in [0, 1] - if alpha_channel_original.max() > 1.0: + if np.max(alpha_channel_original) > 1.0: normalized_alpha = alpha_channel_original / 255.0 else: # Already in [0, 1], preserve as-is @@ -435,7 +435,7 @@ def _normalize_zscore(array: np.ndarray) -> np.ndarray: normalized_alpha = alpha_channel / dtype_max else: # Float type: if > 1, assume [0, 255] range, else already in [0, 1] - if alpha_channel.max() > 1.0: + if np.max(alpha_channel) > 1.0: normalized_alpha = alpha_channel / 255.0 else: # Already in [0, 1], preserve as-is @@ -459,7 +459,7 @@ def _normalize_zscore(array: np.ndarray) -> np.ndarray: normalized_alpha = alpha_channel / dtype_max else: # Float type: if > 1, assume [0, 255] range, else already in [0, 1] - if alpha_channel.max() > 1.0: + if np.max(alpha_channel) > 1.0: normalized_alpha = alpha_channel / 255.0 else: # Already in [0, 1], preserve as-is From 5add8428d026021f22bea5f9130c6b36ef648938 Mon Sep 17 00:00:00 2001 From: sdata07 Date: Fri, 21 Aug 2026 12:19:19 -0400 Subject: [PATCH 3/3] Fix rgb_min calculation for normalization --- fenn/experimental/vision/normalize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fenn/experimental/vision/normalize.py b/fenn/experimental/vision/normalize.py index fe0e059..265e8ae 100644 --- a/fenn/experimental/vision/normalize.py +++ b/fenn/experimental/vision/normalize.py @@ -291,7 +291,7 @@ def _normalize_imagenet_stats(array: np.ndarray) -> np.ndarray: # Auto-normalize only RGB channels to [0, 1] if needed rgb_max = np.max(rgb_channels_float) - rgb_min = np.max(rgb_channels_float) + rgb_min = np.min(rgb_channels_float) if rgb_min < 0.0: if rgb_max <= 1.0: