This document provides a brief intro of the usage of builtin command-line tools in MindYOLO.
./configs/yolov7/yolov7.yaml
.infer.py
that is able to demo builtin configs. Run it with:python infer.py \
--config ./configs/yolov7/yolov7.yaml \
--device_target=Ascend \
--weight=MODEL.WEIGHTS \
--image_path /PATH/TO/IMAGE.jpg
The configs are made for training, therefore we need to specify MODEL.WEIGHTS
to a model from model zoo for inference.
This command will run the inference and show visualizations in an OpenCV window.
For details of the command line arguments, see infer.py -h
or look at its source code
to understand its behavior. Some common arguments are:
./detect_results
Prepare your dataset in YOLO format. If train with COCO dataset, prepare it from yolov5 or 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:
mpirun --allow-run-as-root -n 8 python train.py
e.g.:
mpirun --allow-run-as-root -n 8 python train.py \
--config ./configs/yolov7/yolov7.yaml \
--device_target Ascend \
--is_parallel True > log.txt 2>&1 &
tail -f ./log.txt
The configs are made for 8 NPU/GPU training.
To train on 1 NPU/GPU, you may need to change some parameters, e.g.:
python train.py \
--config ./configs/yolov7/yolov7.yaml \
--device_target Ascend \
--per_batch_size 16
To evaluate a model's performance, use
python test.py \
--config ./configs/yolov7/yolov7.yaml \
--device_target Ascend \
--weight=MODEL.WEIGHTS
For more options, see train/test.py -h
.
To be supplemented.
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》