reworked iop_corr, added explainability tools and plotting tools, cleanup codebase
This commit is contained in:
+1318
-35
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@ REPO_ROOT = Path(__file__).resolve().parents[3]
|
||||
if str(REPO_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
|
||||
from classes.unet_segmenter import UNetSegmenter
|
||||
from classes.v2.unet_segmenter import UNetSegmenter
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Image-only runs v2.21 (6 total):
|
||||
# No crop: binary | multiclass
|
||||
# GT crop: binary | multiclass
|
||||
# UNet crop: binary | multiclass
|
||||
#
|
||||
# Purpose: isolate the effect of ROI cropping at the single-CNN level,
|
||||
# without any MD tower contribution (bridge-mode=image_only).
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
MANIFEST="manifest.csv"
|
||||
UNET_WEIGHTS="models/v2/refuge/segmentation/per_image/best.pt"
|
||||
|
||||
COMMON=(
|
||||
--epochs 40
|
||||
--n-splits 5
|
||||
--batch-size 8
|
||||
--backbone refugelike
|
||||
--tower-mode single
|
||||
--bridge-mode image_only
|
||||
--single-warmup-tower-epochs 4
|
||||
--single-warmup-fused-epochs 0
|
||||
--img-crop-manifest "$MANIFEST"
|
||||
)
|
||||
|
||||
# ── No crop ──────────────────────────────────────────────────────────────────
|
||||
|
||||
echo "[1/6] No crop — binary, image-only..."
|
||||
python3 scripts/main/v2/run_multifold_v2.py \
|
||||
"${COMMON[@]}" --eval-mode binary \
|
||||
--run-name v2.21_imgonly_binary_nocrop_40ep_5fold
|
||||
|
||||
echo "[2/6] No crop — multiclass, image-only..."
|
||||
python3 scripts/main/v2/run_multifold_v2.py \
|
||||
"${COMMON[@]}" --eval-mode multiclass \
|
||||
--run-name v2.21_imgonly_multiclass_nocrop_40ep_5fold
|
||||
|
||||
# ── GT crop ──────────────────────────────────────────────────────────────────
|
||||
|
||||
echo "[3/6] GT crop — binary, image-only..."
|
||||
python3 scripts/main/v2/run_multifold_v2.py \
|
||||
"${COMMON[@]}" --eval-mode binary --img-crop-gt \
|
||||
--run-name v2.21_imgonly_binary_gt_40ep_5fold
|
||||
|
||||
echo "[4/6] GT crop — multiclass, image-only..."
|
||||
python3 scripts/main/v2/run_multifold_v2.py \
|
||||
"${COMMON[@]}" --eval-mode multiclass --img-crop-gt \
|
||||
--run-name v2.21_imgonly_multiclass_gt_40ep_5fold
|
||||
|
||||
# ── UNet crop ────────────────────────────────────────────────────────────────
|
||||
|
||||
echo "[5/6] UNet crop — binary, image-only..."
|
||||
python3 scripts/main/v2/run_multifold_v2.py \
|
||||
"${COMMON[@]}" --eval-mode binary \
|
||||
--img-crop-weights "$UNET_WEIGHTS" \
|
||||
--run-name v2.21_imgonly_binary_unet_40ep_5fold
|
||||
|
||||
echo "[6/6] UNet crop — multiclass, image-only..."
|
||||
python3 scripts/main/v2/run_multifold_v2.py \
|
||||
"${COMMON[@]}" --eval-mode multiclass \
|
||||
--img-crop-weights "$UNET_WEIGHTS" \
|
||||
--run-name v2.21_imgonly_multiclass_unet_40ep_5fold
|
||||
|
||||
echo "Image-only v2.21 runs complete."
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "=== v2.3 ensemble binary nocrop ==="
|
||||
python scripts/basic_analysis/compare_hypertower_modes.py \
|
||||
--tower-modes ensemble --eval-modes binary \
|
||||
--epochs 40 --n-splits 5 \
|
||||
--backbone refugelike \
|
||||
--img-crop-manifest analysis_data/unet_manifest.csv \
|
||||
--run-name v2.3_ensemble_binary_nocrop
|
||||
|
||||
echo "=== v2.3 ensemble multiclass nocrop ==="
|
||||
python scripts/basic_analysis/compare_hypertower_modes.py \
|
||||
--tower-modes ensemble --eval-modes multiclass \
|
||||
--epochs 40 --n-splits 5 \
|
||||
--backbone refugelike \
|
||||
--img-crop-manifest analysis_data/unet_manifest.csv \
|
||||
--run-name v2.3_ensemble_multiclass_nocrop
|
||||
|
||||
echo "=== done ==="
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "=== v2.3 fused binary nocrop ==="
|
||||
python scripts/basic_analysis/compare_hypertower_modes.py \
|
||||
--tower-modes ensemble --eval-modes binary \
|
||||
--epochs 40 --n-splits 5 \
|
||||
--backbone refugelike \
|
||||
--img-crop-manifest analysis_data/unet_manifest.csv \
|
||||
--warmup-md-epochs 50 \
|
||||
--fused-head \
|
||||
--run-name v2.3_fused_binary_nocrop
|
||||
|
||||
echo "=== v2.3 fused multiclass nocrop ==="
|
||||
python scripts/basic_analysis/compare_hypertower_modes.py \
|
||||
--tower-modes ensemble --eval-modes multiclass \
|
||||
--epochs 40 --n-splits 5 \
|
||||
--backbone refugelike \
|
||||
--img-crop-manifest analysis_data/unet_manifest.csv \
|
||||
--warmup-md-epochs 50 \
|
||||
--fused-head \
|
||||
--run-name v2.3_fused_multiclass_nocrop
|
||||
|
||||
echo "=== done ==="
|
||||
Reference in New Issue
Block a user