This document provides a brief introduction to the usage of built-in command-line tools in MindYOLO.
./configs/yolov7/yolov7.yaml
.# Run with Ascend (By default)
python demo/predict.py --config ./configs/yolov7/yolov7.yaml --weight=/path_to_ckpt/WEIGHT.ckpt --image_path /path_to_image/IMAGE.jpg
# Run with GPU
python demo/predict.py --config ./configs/yolov7/yolov7.yaml --weight=/path_to_ckpt/WEIGHT.ckpt --image_path /path_to_image/IMAGE.jpg --device_target=GPU
For details of the command line arguments, see demo/predict.py -h
or look at its source code
to understand their behavior. Some common arguments are:
./detect_results
Prepare your dataset in YOLO format. If trained with COCO (YOLO format), prepare it from yolov5 or the darknet.
coco/
{train,val}2017.txt
annotations/
instances_{train,val}2017.json
images/
{train,val}2017/
00000001.jpg
...
# image files that are mentioned in the corresponding train/val2017.txt
labels/
{train,val}2017/
00000001.txt
...
# label files that are mentioned in the corresponding train/val2017.txt
To train a model on 8 NPUs/GPUs:
mpirun --allow-run-as-root -n 8 python train.py --config ./configs/yolov7/yolov7.yaml --is_parallel True
To train a model on 1 NPU/GPU/CPU:
python train.py --config ./configs/yolov7/yolov7.yaml
To evaluate a model's performance on 1 NPU/GPU/CPU:
python test.py --config ./configs/yolov7/yolov7.yaml --weight /path_to_ckpt/WEIGHT.ckpt
To evaluate a model's performance 8 NPUs/GPUs:
mpirun --allow-run-as-root -n 8 python test.py --config ./configs/yolov7/yolov7.yaml --weight /path_to_ckpt/WEIGHT.ckpt --is_parallel True
Notes: (1) The default hyper-parameter is used for 8-card training, and some parameters need to be adjusted in the case of a single card. (2) The default device is Ascend, and you can modify it by specifying 'device_target' as Ascend/GPU/CPU, as these are currently supported.
train/test.py -h
.See here.
To be supplemented.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。