在Android Studio中为Dnn.readNetFromDarknet(cfgPath, weightPath)添加权重和cfg路径,可以按照以下步骤进行操作:
dependencies {
implementation project(':opencv')
}
String cfgPath = "file:///android_asset/your_cfg_file.cfg";
String weightPath = "file:///android_asset/your_weight_file.weights";
Net net = Dnn.readNetFromDarknet(cfgPath, weightPath);
其中,your_cfg_file.cfg是你的cfg文件名,your_weight_file.weights是你的权重文件名。
这样,你就成功地在Android Studio中为Dnn.readNetFromDarknet(cfgPath, weightPath)添加了权重和cfg路径。请注意,这里的路径是相对于assets文件夹的路径。
领取专属 10元无门槛券
手把手带您无忧上云