# yolov5
python data_split.py --image_dir ../fuck/new_data/images/
python data_split.py --image_dir ../fuck/new_data/images/ --annotation_dir ../fuck/new_data/images/ --img_output_dir ../fuck/new_data/split/ --annotation_output_dir ../fuck/new_data/split/
**Tensorboard**
tensorboard --logdir ./ --port=8888 --host=0.0.0.0
**xmltotxt**
python xmltotxt.py -c classes.txt -xml xml_input_folder -out output_folder
**Training**
python train.py --data digit2.yaml --batch 200
python train.py --data digit.yaml --batch 380 --epochs=500 --freeze=12 --device=0,1
python train.py --data allscene_aftersplit/allscene.yaml --workers 10 --cache --batch 160 --device 0,1 --weights yolov5m6.pt
freeze backbone=10, all=24
freeze=50 會跳錯誤

python train.py --data steel-shift.yaml --batch 180 --epochs=500 --freeze=24 --device=0,1,2,3 --workers 32 --cfg models/yolov5x.yaml --hyp data/hyps/hyp.scratch_steel.yaml
python train.py --data steel-shift.yaml --batch 260 --epochs=500 --freeze=24 --device=0,1,2,3 --workers 32 --cfg yolov5l6.yaml --hyp data/hyps/hyp.scratch_steel.yaml
python train.py --data steel_roi/steel_roi.yaml --batch 80 --device=0,1 --workers 2 --cache --weights yolov5m6.pt --hyp steel_roi/hyp.scratch_roi.yaml
```
#digit2.yaml
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ./data/digit2 # dataset root dir
train: train/ # train images (relative to 'path') 118287 images
val: valid/ # train images (relative to 'path') 5000 images
#test: test_digit.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
# Classes
nc: 1 # number of classes
names: ['digit'] # class names
```
**evalution**
python detect.py --weights weights.pt --img 640 --conf confidence_score --source ../video2image/2.mp4 #video or photo