Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
lijing 8c9a55888b | 2 years ago | |
---|---|---|
coco | 3 years ago | |
data | 3 years ago | |
inference/images | 3 years ago | |
models | 3 years ago | |
test | 2 years ago | |
utils | 2 years ago | |
weights | 3 years ago | |
Dockerfile | 3 years ago | |
LICENSE | 3 years ago | |
README-ori.md | 3 years ago | |
README.md | 2 years ago | |
detect.py | 3 years ago | |
docker_start.sh | 3 years ago | |
env_new.sh | 3 years ago | |
evaluation_npu_1p.sh | 3 years ago | |
export_onnx.py | 3 years ago | |
hubconf.py | 3 years ago | |
requirements-GPU.txt | 3 years ago | |
requirements.txt | 2 years ago | |
test.py | 3 years ago | |
train.py | 2 years ago | |
train_mp.py | 2 years ago | |
train_npu_1p.sh | 3 years ago | |
train_npu_8p_mp.sh | 3 years ago | |
tutorial.ipynb | 3 years ago |
yolov5版本Tags=v2.0, python版本为3.7.5
├── coco_data: #根目录
├── train2017 #训练集图片,约118287张
├── val2017 #验证集图片,约5000张
└── annotations #标注目录
├── instances_train2017.json #对应目标检测、分割任务的训练集标注文件
├── instances_val2017.json #对应目标检测、分割任务的验证集标注文件
├── captions_train2017.json
├── captions_val2017.json
├── person_keypoints_train2017.json
└── person_keypoints_val2017.json
(1)将代码仓中coco/coco2yolo.py和coco/coco_class.txt拷贝到coco_data根目录
(2)运行coco2yolo.py
python3 coco2yolo.py
(3)运行上述脚本后,将在coco_data根目录生成train2017.txt和val2017.txt
修改data/coco.yaml文件中的train字段和val字段,分别指向上一节生成的train2017.txt和val2017.txt,如:
train: /data/coco_data/train2017.txt
val: /data/coco_data/val2017.txt
按照requirements-GPU.txt安装python依赖包
按照requirements.txt安装python依赖包 ,还需安装(NPU-driver.run, NPU-firmware.run, NPU-toolkit.run, torch-ascend.whl, apex.whl)
为了获得最好的图像处理性能,请编译安装opencv-python而非直接安装。编译安装步骤如下:
export GIT_SSL_NO_VERIFY=true
git clone https://github.com/opencv/opencv.git
cd opencv
mkdir -p build
cd build
cmake -D BUILD_opencv_python3=yes -D BUILD_opencv_python2=no -D PYTHON3_EXECUTABLE=/usr/local/python3.7.5/bin/python3.7m -D PYTHON3_INCLUDE_DIR=/usr/local/python3.7.5/include/python3.7m -D PYTHON3_LIBRARY=/usr/local/python3.7.5/lib/libpython3.7m.so -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/python3.7.5/lib/python3.7/site-packages/numpy/core/include -D PYTHON3_PACKAGES_PATH=/usr/local/python3.7.5/lib/python3.7/site-packages -D PYTHON3_DEFAULT_EXECUTABLE=/usr/local/python3.7.5/bin/python3.7m ..
make -j$nproc
make install
bash train_npu_1p.sh
bash train_npu_8p_mp.sh
(1)将evaluation_npu_1p.sh 中的参数--coco_instance_path修改为数据集中的实际路径,如将该脚本修改为
python3.7 test.py --data /data/coco.yaml --coco_instance_path /data/coco/annotations/instances_val2017.json --img-size 672 --weight 'yolov5_0.pt' --batch-size 32 --device npu --npu 0
(2)启动评估
bash evaluation_npu_1p.sh
python train.py --data coco.yaml --cfg yolov5x.yaml --weights '' --batch-size 32 --device 0
python -m torch.distributed.launch --nproc_per_node 8 train.py --data coco.yaml --cfg yolov5x.yaml --weights '' --batch-size 256
python train.py --data coco.yaml --cfg yolov5x.yaml --weights '' --batch-size 32 --device cpu
python export_onnx.py --weights ./xxx.pt --img-size 640 --batch-size 1
No Description
Jupyter Notebook Python Shell Markdown
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》