cv::dnn::readNetFromTensorflow where can find model_path and pbtxt_path

hi, where i can find model_path & pbtxt_path files?

in this path : \opencv_extra-4.5.4\testdata\dnn\tensorflow
There are over 100 files with “.pb” and “.pbtxt” extensions, which one should I use?

    std::string model_path = "";
    std::string pbtxt_path = "";
    cv::dnn::Net net = cv::dnn::readNetFromTensorflow(model_path, pbtxt_path);

please be more precise about what you are trying to do, what model you try to use, etc

There are over 100 files with “.pb” and “.pbtxt” extensions,

probably thousands of it on the net

for which sake ?

I am trying to test this code :
OpenCV\4.5.4\build\install\samples\mcc\chart_detection_with_network.cpp

To detect chart like the one below and calibrate the colors of the image

But the following code, I do not know how to give a value to these two variables [ model_path, pbtxt_path ]

std::string model_path = ""; // ???
std::string pbtxt_path = "";  // ???
cv::dnn::Net net = cv::dnn::readNetFromTensorflow(model_path, pbtxt_path);
1 Like

ok, good joke here

well, they require a pretrained model, but never tell, where it is …

It looks like the original pull request for this feature was at WIP [GSoC 2020] Macbeth Chart detection by AjitPant · Pull Request #2532 · opencv/opencv_contrib · GitHub ; and there it says “Link to trained model: macbeth - Google Drive”.

The Google Drive link actually still works; but I have no idea what that model is trained for (was it trained for all three supported color charts?). And I can load the models, but I don’t see any improvement in the detection – not sure what the neural-network approach is supposed to deliver.

Anyway, it might be good to archive the model files somewhere before the Google Drive link accidentally disappears?

compare to https://github.com/pedrodiamel/colorchecker-detection/tree/master/models/detection which was the apparent basis for that GSoC work

it’s very likely the same model, probably even the same weights