Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update train.py #294

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*/__pycache__
/runs
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python train2yolo",
"type": "debugpy",
"request": "launch",
"program": "data/train2yolo.py",
"args": [
"/data1/zhn/dataset/widerface/train",
"/data1/zhn/dataset/widerface_yolo/train",
],
"console": "integratedTerminal"
},
{
"name": "Python val2yolo",
"type": "debugpy",
"request": "launch",
"program": "data/val2yolo.py",
"args": [
"/data1/zhn/dataset/widerface",
"/data1/zhn/dataset/widerface_yolo/val",
],
"console": "integratedTerminal"
}
]
}
1 change: 1 addition & 0 deletions bash_train.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CUDA_VISIBLE_DEVICES="0,3,4,5" python3 train.py --data data/widerface.yaml --cfg models/yolov5s.yaml --weights '/data1/zhn/dataset/yolov5s-face.pt'
4 changes: 2 additions & 2 deletions data/widerface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
download: bash data/scripts/get_voc.sh

# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
train: /ssd_1t/derron/yolov5-face/data/widerface/train # 16551 images
val: /ssd_1t/derron/yolov5-face/data/widerface/val # 16551 images
train: /data1/zhn/dataset/widerface_yolo/train # 16551 images
val: /data1/zhn/dataset/widerface_yolo/val # 16551 images
#val: /ssd_1t/derron/yolov5-face/data/widerface/train/ # 4952 images

# number of classes
Expand Down
3 changes: 3 additions & 0 deletions data2yolo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python3 data/train2yolo.py /data1/zhn/dataset/widerface/train /data1/zhn/dataset/widerface_yolo/train

python3 data/val2yolo.py /data1/zhn/dataset/widerface /data1/zhn/dataset/widerface_yolo/val
2 changes: 2 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from threading import Thread
from warnings import warn



import numpy as np
import torch.distributed as dist
import torch.nn as nn
Expand Down