File size: 1,229 Bytes
2fe488a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""Central path configuration for Biohub tracking datasets."""

import os
import sys
from pathlib import Path

INTERACTIVE = sys.stderr.isatty()

USERNAME = os.environ.get("USER", os.environ.get("USERNAME", "unknown"))

_BASE = Path(__file__).resolve().parent.parent

# Kaggle competition mount (present when running in a Kaggle notebook).
_KAGGLE_TRAIN = Path(
    "/kaggle/input/competitions/biohub-cell-tracking-during-development/train"
)


def _default_dataset_path() -> Path:
    """Resolve the dataset directory.

    Priority:
      1. ``$BIOHUB_DATA_DIR`` — explicit override (any environment).
      2. the Kaggle competition ``train`` mount, when running on Kaggle.
      3. local ``./data/dense_channel`` — default for local development.

    Scripts also accept ``--data-dir`` to override this per run (e.g. to point
    at the competition ``test`` directory for prediction).
    """
    env = os.environ.get("BIOHUB_DATA_DIR")
    if env:
        return Path(env)
    if _KAGGLE_TRAIN.exists():
        return _KAGGLE_TRAIN
    return _BASE / "data/dense_channel"


DATASET_PATH = _default_dataset_path()
PREDICTIONS_PATH = _BASE / "predictions"
RESULTS_PATH = _BASE / "results"
WEIGHTS_PATH = _BASE / "weights"