From c7d5bc970911ecc18d14c393bb796e06b4a109d3 Mon Sep 17 00:00:00 2001 From: Changjun Date: Mon, 22 Apr 2024 23:52:07 +0800 Subject: [PATCH] change model_path in line 284 in src/model.cpp; add a notice in README.md --- yolov8/README.md | 8 ++++++-- yolov8/src/model.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/yolov8/README.md b/yolov8/README.md index dad23bcb..e21c5ce4 100644 --- a/yolov8/README.md +++ b/yolov8/README.md @@ -119,8 +119,12 @@ python yolov8_cls.py # Classification 1. Prepare calibration images, you can randomly select 1000s images from your train set. For coco, you can also download my calibration images `coco_calib` from [GoogleDrive](https://drive.google.com/drive/folders/1s7jE9DtOngZMzJC1uL307J2MiaGwdRSI?usp=sharing) or [BaiduPan](https://pan.baidu.com/s/1GOm_-JobpyLMAqZWCDUhKg) pwd: a9wh -2. unzip it in yolov8/build - +2. unzip it in yolov8/build. +Notice: if you use your own dataset, you should change its name into coco_calib if you don't want to chang the path (which means "./coco_calib/") in src/model.cpp in line 284: +``` + auto* calibrator = new Int8EntropyCalibrator2(1, kInputW, kInputH, "./coco_calib/", "int8calib.table", kInputTensorName); + config->setInt8Calibrator(calibrator); +``` 3. set the macro `USE_INT8` in config.h and make 4. serialize the model and test diff --git a/yolov8/src/model.cpp b/yolov8/src/model.cpp index 316b1301..d8423e42 100644 --- a/yolov8/src/model.cpp +++ b/yolov8/src/model.cpp @@ -281,7 +281,7 @@ nvinfer1::IHostMemory* buildEngineYolov8Det(nvinfer1::IBuilder* builder, nvinfer assert(builder->platformHasFastInt8()); config->setFlag(nvinfer1::BuilderFlag::kINT8); auto* calibrator = - new Int8EntropyCalibrator2(1, kInputW, kInputH, "../coco_calib/", "int8calib.table", kInputTensorName); + new Int8EntropyCalibrator2(1, kInputW, kInputH, "./coco_calib/", "int8calib.table", kInputTensorName); config->setInt8Calibrator(calibrator); #endif