Skip to content

Commit b834e95

Browse files
kylen-dxiziu
authored andcommitted
Fix bare imports missed during ms/ package restructure
Remaining bare imports (e.g. from weights, from pipeline_config, from GazeTracking, from ObjectDetection) broke the GUI at runtime. Updated all to use ms. prefix.
1 parent f84fcf9 commit b834e95

13 files changed

Lines changed: 22 additions & 22 deletions

File tree

ms/DataCollection/chart_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def resolve_chart_path(charts_arg, source) -> Path | None:
4343
"""
4444
if not charts_arg:
4545
return None
46-
from constants import OUTPUTS_ROOT
46+
from ms.constants import OUTPUTS_ROOT
4747
if charts_arg is True:
4848
stem = Path(str(source)).stem if not isinstance(source, int) else 'webcam'
4949
return OUTPUTS_ROOT / 'Charts' / f'{stem}_Charts.png'

ms/DataCollection/dashboard_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def compose_dashboard(ctx, **kwargs):
590590
"""
591591
global _mpl_renderer
592592
if _mpl_renderer is None:
593-
from DataCollection.dashboard_matplotlib import DashboardRenderer
593+
from ms.DataCollection.dashboard_matplotlib import DashboardRenderer
594594
_mpl_renderer = DashboardRenderer()
595595

596596
return _mpl_renderer.render(ctx['frame'], ctx)

ms/GUI/gaze_tab/output_section.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def _aux_browse_source(self):
152152

153153
def _aux_stream_configs(self):
154154
"""Read the aux table into a list of AuxStreamConfig or None."""
155-
from pipeline_config import AuxStreamConfig
155+
from ms.pipeline_config import AuxStreamConfig
156156
configs = []
157157
for r in range(self._aux_table.rowCount()):
158158
pid = (self._aux_table.item(r, 0).text().strip()

ms/GUI/pipeline_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def import_pipeline(parent) -> Namespace | None:
2626
return None
2727

2828
try:
29-
from pipeline_loader import load_pipeline
29+
from ms.pipeline_loader import load_pipeline
3030
ns = load_pipeline(path, Namespace())
3131
QMessageBox.information(
3232
parent, "Pipeline Imported",

ms/GUI/project_tab/participants_section.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def populate(self, project_cfg, sources, project_path=None):
115115
self._table.setItem(i, 1, QTableWidgetItem(str(tid)))
116116
self._table.setItem(i, 2, QTableWidgetItem(label))
117117
else:
118-
from participant_ids import load_participant_csv
118+
from ms.participant_ids import load_participant_csv
119119
csv_path = project_path / "participant_ids.csv" \
120120
if project_path else None
121121
if csv_path and csv_path.is_file():

ms/GUI/project_tab/project_tab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def _update_output_info(self):
502502
# ── Save project.yaml ───────────────────────────────────────────────────
503503

504504
def _build_project_config(self):
505-
from pipeline_config import ProjectConfig, ProjectOutputConfig
505+
from ms.pipeline_config import ProjectConfig, ProjectOutputConfig
506506
pipe = self._pipeline_path.text().strip() or None
507507
conditions = self._conditions.get_conditions()
508508
participants = self._participants.get_participants()

ms/GUI/workers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _main(self):
7171

7272
import cv2
7373

74-
from MindSight import _build_from_args, run
74+
from ms.cli import _build_from_args, run
7575

7676
self._log("Initializing models...")
7777

@@ -194,9 +194,9 @@ def _main(self):
194194

195195
import cv2
196196

197-
from MindSight import _build_from_args, run
198-
from pipeline_config import OutputConfig
199-
from pipeline_loader import load_pipeline
197+
from ms.cli import _build_from_args, run
198+
from ms.pipeline_config import OutputConfig
199+
from ms.pipeline_loader import load_pipeline
200200
from project_runner import (
201201
discover_aux_streams,
202202
discover_participant_ids,
@@ -242,7 +242,7 @@ def _main(self):
242242

243243
# Discover auxiliary streams
244244
aux_streams = discover_aux_streams(project)
245-
from participant_ids import load_aux_streams_from_csv
245+
from ms.participant_ids import load_aux_streams_from_csv
246246
csv_path = project / "participant_ids.csv"
247247
if csv_path.is_file():
248248
csv_aux = load_aux_streams_from_csv(csv_path)
@@ -343,7 +343,7 @@ def _gui_waitkey(delay):
343343
# ── Post-processing: global and per-condition CSVs ───────────
344344
csv_dir = out_root / "CSV Files"
345345
self._log("\nGenerating global CSVs...")
346-
from DataCollection.global_csv import (
346+
from ms.DataCollection.global_csv import (
347347
generate_condition_csvs,
348348
generate_global_csv,
349349
)
@@ -418,7 +418,7 @@ def _main(self):
418418
import cv2
419419
from ultralytics import YOLOE
420420

421-
from weights import resolve_weight
421+
from ms.weights import resolve_weight
422422
resolved = str(resolve_weight("YOLO", self.model_path))
423423
self._log(f"Loading YOLOE: {resolved}")
424424
model = YOLOE(resolved)

ms/GazeTracking/Backends/L2CS/L2CS_Tracking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def estimate(self, face_bgr):
223223

224224
def run_pipeline(self, **kwargs):
225225
"""Delegate to the generic pitch/yaw per-face pipeline."""
226-
from GazeTracking.pitchyaw_pipeline import run_pitchyaw_pipeline
226+
from ms.GazeTracking.pitchyaw_pipeline import run_pitchyaw_pipeline
227227
return run_pitchyaw_pipeline(gaze_eng=self, **kwargs)
228228

229229
# -- CLI protocol ----------------------------------------------------------
@@ -243,7 +243,7 @@ def add_arguments(cls, parser):
243243
@classmethod
244244
def from_args(cls, args):
245245
"""Create an L2CS engine from parsed CLI args."""
246-
from weights import resolve_weight
246+
from ms.weights import resolve_weight
247247
model = getattr(args, "l2cs_model", None)
248248
if not model:
249249
return None

ms/GazeTracking/Backends/MGaze/MGaze_Tracking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def estimate(self, face_bgr):
118118

119119
def run_pipeline(self, **kwargs):
120120
"""Delegate to the generic pitch/yaw per-face pipeline."""
121-
from GazeTracking.pitchyaw_pipeline import run_pitchyaw_pipeline
121+
from ms.GazeTracking.pitchyaw_pipeline import run_pitchyaw_pipeline
122122
return run_pitchyaw_pipeline(gaze_eng=self, **kwargs)
123123

124124
# ── CLI protocol ─────────────────────────────────────────────────────────
@@ -137,7 +137,7 @@ def add_arguments(cls, parser):
137137
@classmethod
138138
def from_args(cls, args):
139139
"""Create an MGaze engine from parsed CLI args."""
140-
from weights import resolve_weight
140+
from ms.weights import resolve_weight
141141
model = getattr(args, "mgaze_model", None)
142142
if not model:
143143
return None

ms/GazeTracking/Backends/UniGaze/UniGaze_Tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def estimate(self, face_bgr):
9999
return self._engine.estimate(face_bgr)
100100

101101
def run_pipeline(self, **kwargs):
102-
from GazeTracking.pitchyaw_pipeline import run_pitchyaw_pipeline
102+
from ms.GazeTracking.pitchyaw_pipeline import run_pitchyaw_pipeline
103103
return run_pitchyaw_pipeline(gaze_eng=self, **kwargs)
104104

105105
# -- CLI protocol ----------------------------------------------------------

0 commit comments

Comments
 (0)