Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mito_train/training/train_board_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from importlib.metadata import version as _pkg_version
from pathlib import Path

from dotenv import load_dotenv

import torch
import torch.nn as nn
import torch.nn.functional as F
Expand Down Expand Up @@ -506,6 +508,9 @@ def log_main(msg: str) -> None:


def main() -> None:
# Pull HF_TOKEN / WANDB_API_KEY / CF_* out of .env into os.environ before
# any HF or wandb call resolves credentials. No-op if .env is missing.
load_dotenv()
p = argparse.ArgumentParser()
p.add_argument("--mode", choices=["smoke", "full"], default="smoke")
p.add_argument("--backbone", default="mobilenet_v3_small",
Expand Down
5 changes: 5 additions & 0 deletions mito_train/training/train_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import argparse
from pathlib import Path

from dotenv import load_dotenv

import torch
import torch.nn as nn
import torch.nn.functional as F
Expand Down Expand Up @@ -74,6 +76,9 @@ def evaluate(model: nn.Module, loader: DataLoader, device: str) -> dict[str, flo


def main() -> None:
# Pull HF_TOKEN / WANDB_API_KEY / CF_* out of .env into os.environ before
# any wandb or HF call resolves credentials. No-op if .env is missing.
load_dotenv()
p = argparse.ArgumentParser()
p.add_argument("--train-manifest", type=Path, default=Path("data/detector/train.jsonl"))
p.add_argument("--val-manifest", type=Path, default=Path("data/detector/val.jsonl"))
Expand Down
5 changes: 5 additions & 0 deletions mito_train/training/train_piece.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import os
from pathlib import Path

from dotenv import load_dotenv

import torch
import torch.nn as nn
from torch.utils.data import DataLoader
Expand Down Expand Up @@ -219,6 +221,9 @@ def run_manifest(args: argparse.Namespace) -> None:


def main() -> None:
# Pull WANDB_API_KEY / CF_* / HF_TOKEN out of .env into os.environ before
# any wandb or HF call resolves credentials. No-op if .env is missing.
load_dotenv()
p = argparse.ArgumentParser()
p.add_argument("--mode", choices=["smoke", "manifest"], default="smoke")
# smoke-mode args
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mito-train"
version = "0.3.0"
version = "0.3.1"
description = "ぴよ将棋OCR 3モデル (board-detector / piece-classifier / hand-classifier) の学習・ONNX出力"
requires-python = ">=3.11"
dependencies = [
Expand All @@ -15,6 +15,7 @@ dependencies = [
"onnxscript>=0.7.1",
"opencv-python-headless>=5.0.0.93",
"pillow>=12.3.0",
"python-dotenv>=1.1.1",
"python-shogi>=1.1.1",
"pyyaml>=6.0.3",
"timm>=1.0.28",
Expand Down
13 changes: 12 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading