chore: 初始化 uv 项目配置与忽略规则
- pyproject.toml 采用 uv 应用模式(package = false),直接从仓库根运行入口脚本 - 依赖:torch / torchvision / numpy / pillow / pyyaml / swanlab - dev 组含 pytest 与 ruff,export 组按需安装 onnx / onnxscript - 忽略数据集本体、runs/ 训练产物、权重与 .DS_Store Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
c0e7c23aef
commit
0645fc19f7
+17
@@ -1,3 +1,6 @@
|
|||||||
|
.vscode/
|
||||||
|
CLAUDE.MD
|
||||||
|
|
||||||
# ---> Python
|
# ---> Python
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
@@ -174,3 +177,17 @@ cython_debug/
|
|||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
|
|
||||||
|
# ---- 项目自定义 ----
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# 数据集本体不入库,只保留 data/README.md 与软链说明
|
||||||
|
data/*
|
||||||
|
!data/README.md
|
||||||
|
# 训练产物
|
||||||
|
runs/
|
||||||
|
*.pth
|
||||||
|
*.pt
|
||||||
|
*.onnx
|
||||||
|
*.engine
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
3.12
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
[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>=0.10.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = [
|
||||||
|
"pytest>=8.0",
|
||||||
|
"ruff>=0.6",
|
||||||
|
]
|
||||||
|
# ONNX 导出(部署用),按需安装:uv sync --group export
|
||||||
|
export = [
|
||||||
|
"onnx>=1.16",
|
||||||
|
"onnxscript>=0.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.uv]
|
||||||
|
# 本仓库是应用而非库:不打包安装,直接从仓库根目录运行 train.py / eval.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"
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
select = ["E", "F", "I", "UP", "B"]
|
||||||
Reference in New Issue
Block a user