How to generate a configuration file for tensorflow openpose model ?
In opencv for detection models to generate a config file is used: https://github.com/opencv/opencv/blob...
What I have to change in "tf_text_graph_ssd" or what to use to generate a config file for opencv using the tensorflow openpose model ?
I have the inference openpose model: https://github.com/ildoonet/tf-pose-e...
This is the result of the model using Tensorflow with OpenPose: C:\fakepath\openpose.png
But OpenCV needs a config file. So I don't know how to generate what file for OpenCV
do you want to retrain the openpose model ? or just use the existing COCO or MPI model ?
in the latter case, please try with the openpose.py sample
also, here are the data url's to download
I tried that script(openpose.py) using caffe models and it is working nicely, but now I want to try it with above tensorflow model but I dont know how to generate the config file for opencv. thank you for your help.
@Roma, a text config file is optional. Please tell us what kind of errors appear during import of a single
.pb
model.i tried the tf model (w/o a prototxt, from c++), it has the same layershapes at the top, as the original openpose model ([1, 57, 46, 46]) .
no errors, but the confidence is low(<0.01), and the positions are somewhat off.
@berak when using tensorflow it outputs reasonable results, look the above image.
^^ ohh, nice. but that's using openpose code, not opencv , right ?
(it would be really cool, to get this running in opencv, it's 10x faster !)
can you put the code somewhere ? (curious, what i might be doing wrong here !)
tada, solved it !!!!
(all it needed, was to skip the
1/255
normalization factor in blobFromImage())@dkurt, 10x faster ! only 7mb ! we NEED that !
@berak yes that is using openpose code ^^
@berak very nice ! ^^ your using the above model with c++ and opencv and that is working ?
@berak, Wow, that's amazing! We can replace
readNetFromCaffe
to readNet in both Python and C++ samples. It's independent to binary/text files order and can detect an origin framework automatically. I think it's ok if we makemean
as sample's argument and add a new tableOthers
to https://github.com/opencv/opencv/tree... including two rows with each model.@Roma, yes opencv/c++. i changed the importer (from caffe to tf) and replaced 1/255 with 1 in blobFromImage() (and
nparts==19 || nparts==57
here.similar idea should work with the python code, too.
so, while it does not need a prototxt now, it might still be good, to have one, imho, maybe one could do some further optimization there