a lot of progress

This commit is contained in:
2026-08-11 19:02:47 +02:00
parent 7bdaac855e
commit 62b309adf3
7 changed files with 178 additions and 9 deletions
+17 -9
View File
@@ -6,6 +6,7 @@ import matplotlib.pylab as plt
from matplotlib.widgets import Button
from image_preparing import fix_image_resolution
import transition
class ImageInterface:
@@ -96,15 +97,22 @@ class ImageInterface:
self.current_index = 0
self._show_browser()
def _open_shenanigans(self):
image_paths = self.image_sets.get("source", [])
selected_index = self.selected_indices.get("source")
if selected_index is None:
selected_index = self.current_index if self.current_category == "source" else 0
selected_path = None
if image_paths:
safe_index = max(0, min(selected_index, len(image_paths) - 1))
selected_path = image_paths[safe_index]
fix_image_resolution(selected_path)
src_paths = self.image_sets.get("source", [])
goal_paths = self.image_sets.get("goal", [])
if not src_paths or not goal_paths:
return
sel_src = self.selected_indices.get("source")
sel_goal = self.selected_indices.get("goal")
src_path = src_paths[sel_src] if sel_src is not None else src_paths[0]
goal_path = goal_paths[sel_goal] if sel_goal is not None else goal_paths[0]
try:
import importlib
importlib.reload(transition)
except Exception:
pass
if not hasattr(transition, "transform_images"):
return
transition.transform_images(src_path, goal_path)
def _selected_image_name(self, category):
selected_index = self.selected_indices.get(category)
image_paths = self.image_sets.get(category, [])