In [1]:
import importlib

from forge import *
from puzzle.puzzlepedia import annotation_widget, prod_config, problem_widget, debug_data_widget
from data.image import image, component

prod_config.init()

In [2]:
from os import path
import cv2
import numpy as np
import importlib

from data import data
from puzzle.problems import problem
from puzzle.problems.image import image_problem

def load_image(name: str) -> np.ndarray:
  return cv2.imread(image_path(name), flags=cv2.IMREAD_UNCHANGED)

def image_path(name: str) -> str:
  return path.join(data.project_path('data/grid/original'), name)

In [7]:
importlib.reload(annotation_widget)
importlib.reload(debug_data_widget)
importlib.reload(problem_widget)
importlib.reload(image)
importlib.reload(problem)
importlib.reload(image_problem)
prod_config.reset()
prod_config.init()

solve(load_image('thermo.png'))


Out[7]:
<puzzle.puzzlepedia.puzzle.Puzzle at 0x10f19b518>

In [ ]: