post-restructure
This commit is contained in:
@@ -11,7 +11,7 @@ REPO_ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(REPO_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
|
||||
from classes.v2.v2_hypertower import build_parser, run_mode
|
||||
from classes.v2.v2_hypertower import V2HyperTower
|
||||
|
||||
|
||||
def parse_args():
|
||||
@@ -35,7 +35,7 @@ def parse_args():
|
||||
|
||||
def main():
|
||||
seq_args, remaining = parse_args()
|
||||
base_parser = build_parser()
|
||||
base_parser = V2HyperTower.build_parser()
|
||||
first_run = True
|
||||
for eval_mode in seq_args.eval_modes:
|
||||
for tower_mode in seq_args.tower_modes:
|
||||
@@ -45,7 +45,7 @@ def main():
|
||||
if not first_run:
|
||||
cli.append("--persist-img-crop-cache")
|
||||
args = base_parser.parse_args(cli)
|
||||
run_mode(args)
|
||||
V2HyperTower(args).run()
|
||||
first_run = False
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""CLI wrapper that delegates to classes.frontend.Multifold with V2 loaders."""
|
||||
"""CLI wrapper for the V2 hypertower pipeline using V2HyperTower directly."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -7,30 +7,17 @@ from pathlib import Path
|
||||
import sys
|
||||
|
||||
# ensure repo root on path
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
REPO_ROOT = Path(__file__).resolve().parents[3]
|
||||
if str(REPO_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
|
||||
import classes.frontend as frontend
|
||||
from classes.v2.v2_hypertower import V2HyperTower
|
||||
|
||||
|
||||
def run_cli(cli_args=None):
|
||||
parser = frontend.Multifold.build_parser()
|
||||
parser.set_defaults(warmup_tower_epochs=None, warmup_fused_epochs=None)
|
||||
parser.add_argument(
|
||||
"--sample-mode",
|
||||
choices=["eye", "patient"],
|
||||
default="eye",
|
||||
help="Build samples per eye (row-level) or per patient (multi-slot).",
|
||||
)
|
||||
parser = V2HyperTower.build_parser()
|
||||
args = parser.parse_args(cli_args)
|
||||
|
||||
# Monkeypatch the HyperTower class used inside Multifold.
|
||||
frontend.HyperTower = V2HyperTower
|
||||
|
||||
runner = frontend.Multifold(args)
|
||||
runner.run()
|
||||
V2HyperTower(args).run()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -44,13 +44,10 @@ from classes.v2.data_bundle import DataBundle
|
||||
from classes.v2.papila_builders import build_papila_data
|
||||
from classes.v2.profiles.papila import build_papila_profile
|
||||
from classes.v2.split_manager import PatientFirstSplitManager
|
||||
from classes.v2.v2_hypertower import (
|
||||
SingleEyeHT,
|
||||
_score_arrays,
|
||||
build_eval_transform,
|
||||
filter_bilateral_samples,
|
||||
make_loader,
|
||||
)
|
||||
from classes.v2.loader_factory import filter_bilateral_samples, make_loader
|
||||
from classes.v2.metrics import _score_arrays
|
||||
from classes.v2.models import SingleEyeHT
|
||||
from classes.v2.transforms import build_eval_transform
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Label display helpers
|
||||
|
||||
Reference in New Issue
Block a user