| 70 | |
| 71 | #ifdef USE_OPEN_CV_DNN |
| 72 | inline void reshapeNetOpenCv(caffe::Net<float>* caffeNet, const std::vector<int>& dimensions) |
| 73 | { |
| 74 | try |
| 75 | { |
| 76 | caffeNet->blobs()[0]->Reshape(dimensions); |
| 77 | caffeNet->Reshape(); |
| 78 | #ifdef USE_CUDA |
| 79 | cudaCheck(__LINE__, __FUNCTION__, __FILE__); |
| 80 | #endif |
| 81 | } |
| 82 | catch (const std::exception& e) |
| 83 | { |
| 84 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 85 | } |
| 86 | } |
| 87 | #endif |
| 88 | |
| 89 | NetOpenCv::NetOpenCv(const std::string& caffeProto, const std::string& caffeTrainedModel, const int gpuId) |