Skip to content
1 change: 1 addition & 0 deletions core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions gui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

File renamed without changes.
6 changes: 6 additions & 0 deletions similar_history_match.py → gui/similar_history_match.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import numpy as np
import pandas as pd
# 从父目录找config
import sys
from pathlib import Path
root_dir = Path(__file__).parent.parent
if str(root_dir) not in sys.path:
sys.path.insert(0, str(root_dir))
from config import MONSTER_COUNT
from config import FIELD_FEATURE_COUNT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
import numpy as np
import logging

from similar_history_match import HistoryMatch
from .similar_history_match import HistoryMatch
# 从父目录找config
import sys
from pathlib import Path
root_dir = Path(__file__).parent.parent
if str(root_dir) not in sys.path:
sys.path.insert(0, str(root_dir))
from config import MONSTER_COUNT, MONSTER_DATA

logger = logging.getLogger(__name__)
Expand Down
12 changes: 6 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import loadData
import auto_fetch
from maa_adb_connector import MaaAdbConnector, MaaFrameworkDetector
from dark_mode_style_fix import DarkModeStyleFix
import similar_history_match
from gui.dark_mode_style_fix import DarkModeStyleFix
from gui.similar_history_match import HistoryMatch
from gui.similar_history_match_ui import HistoryMatchUI
import recognize
from recognize import MONSTER_COUNT
from specialmonster import SpecialMonsterHandler
import data_package
import winrt_capture
from config import FIELD_FEATURE_COUNT, MONSTER_DATA
from simular_history_match_ui import HistoryMatchUI
from input_panel_ui import InputPanelUI

logging.getLogger().setLevel(logging.DEBUG)
Expand All @@ -42,12 +42,12 @@


try:
from predict import CannotModel
from core.predict import CannotModel
from train import UnitAwareTransformer

logger.info("Using PyTorch model for predictions.")
except:
from predict_onnx import CannotModel
from core.predict_onnx import CannotModel

logger.info("Using ONNX model for predictions.")

Expand Down Expand Up @@ -123,7 +123,7 @@ def __init__(self):
# 初始化UI后加载历史数据
logger.info("尝试获取错题本")
self.history_match = None
self.history_match = similar_history_match.HistoryMatch()
self.history_match = HistoryMatch()
# Ensure feat_past and N_history are initialized
try:
self.history_match.feat_past = np.hstack([self.history_match.past_left, self.history_match.past_right])
Expand Down
4 changes: 2 additions & 2 deletions main_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import numpy as np
import math
from PIL import Image, ImageTk
from predict import CannotModel
from core.predict import CannotModel
import loadData
import recognize
from train import UnitAwareTransformer
from recognize import MONSTER_COUNT
from similar_history_match import HistoryMatch
from gui.similar_history_match import HistoryMatch
from auto_fetch import AutoFetch

logging.getLogger().setLevel(logging.DEBUG)
Expand Down
6 changes: 3 additions & 3 deletions multi_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import subprocess
from pathlib import Path
from PyQt6.QtWidgets import (
QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout,
QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout,
QPushButton, QLabel, QPlainTextEdit, QSpinBox, QComboBox, QCheckBox,
QMessageBox, QSplitter, QScrollArea, QFrame, QLineEdit
)
Expand Down Expand Up @@ -109,10 +109,10 @@ def get_cannot_model():
if _cannot_model is None:
logger.info("首次初始化 CannotModel...")
try:
from predict import CannotModel
from core.predict import CannotModel
logger.info("Using PyTorch model for predictions.")
except Exception:
from predict_onnx import CannotModel
from core.predict_onnx import CannotModel
logger.info("Using ONNX model for predictions.")

_cannot_model = CannotModel()
Expand Down
4 changes: 2 additions & 2 deletions tools/convert_model.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
sys.path.append(".")

import predict
import core.predict
from train import UnitAwareTransformer
import predict_onnx
import core.predict_onnx
import numpy as np
from recognize import MONSTER_COUNT

Expand Down