How to use weight of a deep neural network which is trained in tensorflow-python api in a c++ project?

Viewed 101

I have trained some classification models with tensorflow 2.4 and now I want to use these trained models in a c++ project. I did similar work by tkDNN library(which is used to increase frame per second (fps)) but in this case I don't want to use tkDNN because I don't care about fps. In the below code I used weight of trained yolo-tiny which is fixed point by tkDNN. Is there any library for feeding weights like this code to use dnn in c++?

int main()
{

int n_classes=3;

const char * net = "/home/tkDNN/build/yolo_tiny_3l_fp16.rt";

// instantiate detector
tk::dnn::Yolo3Detection yolo;
tk::dnn::DetectionNN *detNN;
detNN = &yolo;
int n_batch = 2;
detNN->init(net, n_classes, n_batch);


bool g;
g = true;
cv::VideoCapture cap(0);
if(!cap.isOpened())
    g = false;
else
    std::cout<<"camera started\n";

...
0 Answers
Related