|
各位老师好,最近新接触一个opencv库中的函数cv::dnn::readnet()函数;
参数1是yolo训练好的模型.weights后缀文件,
参数2是超参数.cfg后缀的文件。
如何才能得到这2个后缀的文件呢(*.weigthts和*.cfg),或者其他的也行,因为yolov8训练好的都是*.pt和*.yaml配套。网上还可以发现能导出*.onnx,但是第二个参数怎么整呀?
如何导出一套来呢?只要能用上readnet函数就可以。
官网解释:
Net cv::dnn::readNet | ( | const String & | model, | | | const String & | config = "", | | | const String & | framework = "" | | ) | | |
Python: | | cv.dnn.readNet( | model[, config[, framework]] | ) -> | retval | | cv.dnn.readNet( | framework, bufferModel[, bufferConfig] | ) -> | retval | Parameters[in] | model | Binary file contains trained weights. The following file extensions are expected for models from different frameworks:- *.caffemodel (Caffe, http://caffe.berkeleyvision.org/)
- *.pb (TensorFlow, https://www.tensorflow.org/)
- *.t7 | *.net (Torch, http://torch.ch/)
- *.weights (Darknet, https://pjreddie.com/darknet/)
- *.bin (DLDT, https://software.intel.com/openvino-toolkit)
- *.onnx (ONNX, https://onnx.ai/)
| [in] | config | Text file contains network configuration. It could be a file with the following extensions:- *.prototxt (Caffe, http://caffe.berkeleyvision.org/)
- *.pbtxt (TensorFlow, https://www.tensorflow.org/)
- *.cfg (Darknet, https://pjreddie.com/darknet/)
- *.xml (DLDT, https://software.intel.com/openvino-toolkit)
| [in] | framework | Explicit framework name tag to determine a format. |
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|