仓库里从来没有 train.py / eval.py,入口是 classify.py 与 detect.py。 - README 的计算后端与 SwanLab 示例改用 classify.py,看板路径跟着 work_dir 改为 runs/classify/swanlog。 - 删掉"train.py 的 train.restart_schedule 同理":restart_schedule 只在 engine/simclr.py 里实现,分类训练没有这个选项。 - 目录表里 configs/ 的子目录(原写 model/ dataset/ train/ eval/)与 scripts/ 的描述改成实际内容;入口那行补上 detect.py。 - 导出走 OpenVINO,没有脚本用到 onnx/onnxscript,删掉 export 依赖组。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
57 lines
1.7 KiB
TOML
57 lines
1.7 KiB
TOML
[project]
|
|
name = "modeltraineval"
|
|
version = "0.1.0"
|
|
description = "薄膜缺陷分类定位模型的训练与评估(纯卷积,面向实时设备部署)"
|
|
readme = "README.md"
|
|
authors = [
|
|
{ name = "Shaun Zhou", email = "xiangyuzhou823@gmail.com" }
|
|
]
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"torch>=2.4",
|
|
"torchvision>=0.19",
|
|
"numpy>=1.26",
|
|
"pillow>=10.3",
|
|
"pyyaml>=6.0",
|
|
"swanlab[dashboard]>=0.10.0",
|
|
"matplotlib>=3.8",
|
|
# 检测训练(detect.py)。注意 ultralytics 是 AGPL-3.0:如果模型要随产品分发,
|
|
# 需要开源整套代码或另外向其购买商业授权。仅内部使用则不受影响。
|
|
"ultralytics>=8.4",
|
|
# SHAP 定位(scripts/generate_boxes.py --method shap)用
|
|
"shap>=0.46",
|
|
"label-studio>=1.23.0",
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=8.0",
|
|
"ruff>=0.6",
|
|
]
|
|
# SHAP 归因定位(scripts/shap_boxes.py),按需安装:uv sync --group explain
|
|
explain = [
|
|
"shap>=0.48",
|
|
]
|
|
|
|
[tool.uv]
|
|
# 本仓库是应用而非库:不打包安装,直接从仓库根目录运行 classify.py / detect.py。
|
|
package = false
|
|
|
|
# 训练机(Linux + Nvidia GPU)请用 CUDA 版 torch,例如:
|
|
# uv pip install --index-url https://download.pytorch.org/whl/cu124 torch torchvision
|
|
# 默认 PyPI 源在 Linux 上装的是 CUDA 构建,在 macOS 上只有 CPU 构建(仅可用于评估/导出)。
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
pythonpath = ["."]
|
|
addopts = "-q"
|
|
|
|
[tool.ruff]
|
|
line-length = 110
|
|
target-version = "py312"
|
|
# ml_backend/_wsgi.py 由 label-studio-ml 的官方模板生成,保持原样便于跟随上游更新
|
|
extend-exclude = ["ml_backend/_wsgi.py"]
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B"]
|