Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/yolov8example' into yolov8example
Browse files Browse the repository at this point in the history
  • Loading branch information
whyb committed Jun 12, 2024
2 parents 70f5d5d + b8a4183 commit 8a28d71
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions examples/yolov8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
//
// Copyright (C) 2024 whyb(https://github.com/whyb). All rights reserved.
//
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
Expand All @@ -14,22 +14,21 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.


// ReadMe
// Convert yolov8 model to ncnn model workflow:
//
//
// step 1:
// If you don't want to train the model yourself. You should go to the ultralytics website download the pretrained model file.
// original pretrained model from https://docs.ultralytics.com/models/yolov8/#supported-tasks-and-modes
//
//
// step 2:
// run this command.
// conda create --name yolov8 python=3.11
// conda activate yolov8
// pip install ultralytics onnx numpy protobuf
//
//
// step 3:
// save source code file(export_model_to_ncnn.py):
// save source code file(export_model_to_ncnn.py):
// from ultralytics import YOLO
// detection_models = [
// ["./Detection-pt/yolov8n.pt", "./Detection-pt/"],
Expand All @@ -41,7 +40,7 @@
// for model_dict in detection_models:
// model = YOLO(model_dict[0]) # load an official pretrained weight model
// model.export(format="ncnn", dynamic=True, save_dir=model_dict[1], simplify=True)
//
//
// step 4:
// run command: python export_model_to_ncnn.py

Expand Down Expand Up @@ -256,7 +255,7 @@ static int detect_yolov8(const cv::Mat& bgr, std::vector<Object>& objects)
ex.input("in0", in_pad);

std::vector<Object> proposals;

// stride 32
{
ncnn::Mat out;
Expand Down

0 comments on commit 8a28d71

Please sign in to comment.