diff --git a/cv/detection/yolov11/pytorch/README.md b/cv/detection/yolov11/pytorch/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5052fa9ae04537f06521d18e6c71f78f29142c23 --- /dev/null +++ b/cv/detection/yolov11/pytorch/README.md @@ -0,0 +1,69 @@ +# YOLOv11 + +## Model Description + +Ultralytics YOLO11 is not just another object detection model; it's a versatile framework designed to cover the entire lifecycle of machine learning models—from data ingestion and model training to validation, deployment, and real-world tracking. Each mode serves a specific purpose and is engineered to offer you the flexibility and efficiency required for different tasks and use-cases. + +## Supported Environments + +| GPU | [IXUCA SDK](https://gitee.com/deep-spark/deepspark#%E5%A4%A9%E6%95%B0%E6%99%BA%E7%AE%97%E8%BD%AF%E4%BB%B6%E6%A0%88-ixuca) | Release | +|--------|-----------|---------| +| BI-V150 | 4.2.0 | 25.03 | +| BI-V100 | 3.0.0 | 23.06 | + +## Model Preparation + +### Prepare Resources + +Go to visit [COCO official website](https://cocodataset.org/#download), then select the COCO dataset you want to +download. + +Take coco2017 dataset as an example, specify `/path/to/coco2017` to your COCO path in later training process, the +unzipped dataset path structure sholud look like: + +```bash +coco2017 +├── annotations +│ ├── instances_train2017.json +│ ├── instances_val2017.json +│ └── ... +├── train2017 +│ ├── 000000000009.jpg +│ ├── 000000000025.jpg +│ └── ... +├── val2017 +│ ├── 000000000139.jpg +│ ├── 000000000285.jpg +│ └── ... +├── train2017.txt +├── val2017.txt +└── ... +``` + +```bash +mkdir -p /datasets/ +ln -s /path/to/coco2017 /datasets/ +``` + +### Install Dependencies + +```bash +# Install ultralytics +pip3 install ultralytics +``` + +## Model Training + +```bash +python3 train.py +``` + +## Model Results + +| Model | GPU | FP32 | +|--------|------------|----------| +| YOLOv11 | BI-V150 x8 | MAP=39.5 | + +## References + +- [ultralytics](https://github.com/ultralytics/ultralytics) diff --git a/cv/detection/yolov11/pytorch/train.py b/cv/detection/yolov11/pytorch/train.py new file mode 100644 index 0000000000000000000000000000000000000000..074ce6c357841e29ffbd7d8045516c4c4835ae95 --- /dev/null +++ b/cv/detection/yolov11/pytorch/train.py @@ -0,0 +1,23 @@ +# Copyright (c) 2023, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from ultralytics import YOLO + +# Load a model +model = YOLO("yolov11n.yaml") # build a new model from scratch +# model = YOLO("yolov11n.pt") # load a pretrained model (recommended for training) + +# Use the model +model.train(data="coco.yaml",epochs=100, imgsz=640,batch=128,device="0,1,2,3,4,5,6,7") # train the model