Hi Alex,
Here is where I placed the cfg and weight files:
And here is the C++ VS code I am running:
int main() { cv::VideoCapture webcam(0); cv::Mat frame; webcam.read(frame); vector<string> classNames; ifstream cocoNamesFile; cocoNamesFile.open("C:/darknet/cfg/coco.names"); string line; try { if (cocoNamesFile.fail()) throw 1; while (getline(cocoNamesFile, line)) classNames.push_back(line); for (int i = 0; i < classNames.size(); i++) cout << classNames[i] << endl; cout << "Number of different classes: " << classNames.size() << endl; cocoNamesFile.close(); if (frame.empty()) throw 2; string modelConfiguration = "C:/Users/Blake/source/repos/YOLO/yolov3-608.cfg"; string modelWeights = "C:/Users/Blake/source/repos/YOLO/yolov3-608.weights"; ifstream model; model.open(modelConfiguration); if (model.fail()) throw 3; model.close(); model.open(modelWeights); if (model.fail()) throw 4; model.close(); cv::dnn::Net net = cv::dnn::readNetFromDarknet("C:/Users/Blake/source/repos/YOLO/yolov3-608.cfg", "C:/Users/Blake/source/repos/YOLO/yolov3-608.weights"); net.setPreferableBackend(cv::dnn::DNN_BACKEND_OPENCV); net.setPreferableTarget(cv::dnn::DNN_TARGET_CPU); do { cv::imshow("Webcam Live Feed", frame); cv::waitKey(1); webcam.read(frame); } while (!frame.empty()); } catch (int i) { if (i == 1) cout << "Cannot Open Coco Names File\n"; else if (i == 2) cout << "Cannot Read Web Cam\n"; else if (i == 3) cout << "Cannot Open Model Configuration File\n"; else if (i == 4) cout << "Cannot Open Model Weights File\n"; return EXIT_FAILURE; } return 0; }
I am still getting an exception thrown at the same spot