|
|
2 天之前 | |
|---|---|---|
| .idea | 2 天之前 | |
| __pycache__ | 2 天之前 | |
| 20251102.py | 2 天之前 | |
| README_TRAIN.md | 2 天之前 | |
| SteamSetup.exe | 2 天之前 | |
| autolabel.py | 2 天之前 | |
| best.pt | 2 天之前 | |
| check.py | 2 天之前 | |
| classes.txt | 2 天之前 | |
| dataset_template.yaml | 2 天之前 | |
| frame_reorganizer.py | 2 天之前 | |
| json_to_yolo.py | 2 天之前 | |
| num.py | 2 天之前 | |
| output_segmented_video.mp4 | 2 天之前 | |
| predict.py | 2 天之前 | |
| redataname.py | 2 天之前 | |
| rename.py | 2 天之前 | |
| requirements-train.txt | 2 天之前 | |
| s.py | 2 天之前 | |
| split.py | 2 天之前 | |
| split12.py | 2 天之前 | |
| split_dataset.py | 2 天之前 | |
| test_time_parser.py | 2 天之前 | |
| testimg.py | 2 天之前 | |
| video_frame_extractor.py | 2 天之前 | |
| video_segment_extractor.py | 2 天之前 | |
| yolov8n-seg.pt | 2 天之前 |
准备:
dataset_template.yaml(或复制为 dataset.yaml),确保 train/val/test 指向你的图片文件夹,且 nc 与 names 正确。安装依赖(Windows PowerShell):
python -m venv .venv; .\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements-train.txt
训练示例(PowerShell):
# 使用预训练的 yolov8n 模型,100 epochs,batch 16
python train_yolov8.py --data dataset.yaml --model yolov8n.pt --epochs 100 --batch 16
# 指定输出目录和实验名字
python train_yolov8.py --data dataset.yaml --model yolov8n.pt --epochs 50 --project runs/train --name my_experiment
# 在 CPU 上运行
python train_yolov8.py --data dataset.yaml --model yolov8n.pt --device cpu
注意事项:
torch。如果未安装 GPU 版 torch,程序会自动使用 CPU。.txt,每行 class x_center y_center width height),请先转换为 YOLO 格式。runs/train/<name>/ 下。如需我帮你:
dataset.yaml。