Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Keras to OpenVINO format conversion

Corvid__Zabeth
2,452 Views

Good day.

There are two file: json and .h5, first with description of NN layers, second with weights. Files are generated by Keras framework with tools model to json. Can I convert this NN to IR format directly for OpenVINO use? Or I should load this model to Keras, save as TensorFlow and then convert to IR?

 

2 Replies
Kenneth_C_Intel
Employee
2,452 Views

Hi, you will need to convert from Keras to frozen TF then use that frozen model to convert to IE IR. (using model optimizer).

This script can you help with that process.

Regards,

Kenneth

Kamma__Vijayakumar
2,452 Views

Hi,

 

I have converted my H5 file to frozen model then converted into open vino model.

But, after executing the openvino model , the result is having the ndarray, i am not understanding how to handle the output.

my objective is to detect the Face mask, with confidence and bounding boxes.

 

result {'conv_81/BiasAdd/Add': array([[[[-1.66312973e+02, -2.46958740e+02, -1.74602142e+02, ...,
          -2.83901031e+02, -2.21121582e+02, -9.00830765e+01],
         [-1.20000076e+02, -2.66399963e+02, -1.58648590e+02, ...,
          -2.18675812e+02, -2.38010468e+02, -1.37554138e+02],
         [-1.06553749e+02, -2.97883667e+02, -1.27020409e+02, ...,
          -1.77826111e+02, -2.24372299e+02, -1.44611572e+02],
         ...,
         [-4.78074760e+01, -1.75183441e+02, -1.38157776e+02, ...,
          -4.33831978e+01, -4.24874916e+01, -6.06762924e+01],
         [-1.84533119e+01, -1.68425415e+02, -1.11759216e+02, ...,
          -6.22600098e+01, -5.67313538e+01, -4.46702423e+01],
         [ 2.93867760e+01, -6.70677872e+01, -5.70977402e+01, ...,
          -4.19528961e+01, -3.55563469e+01, -2.01602802e+01]],

        [[ 1.40633591e+02,  1.15974365e+02,  1.17529114e+02, ...,
           1.81284317e+02,  1.42111740e+02,  7.96556702e+01],
         [ 1.27407059e+02,  2.11995117e+02,  1.85863602e+02, ...,
           2.60103180e+02,  2.27830368e+02,  1.25303055e+02],
         [ 1.64037766e+02,  1.96629532e+02,  1.11918442e+02, ...,
           1.56511246e+02,  1.54128342e+02,  8.48983231e+01],
         ...,
         [ 6.33352051e+01,  6.37791214e+01,  7.07268333e+00, ...,
          -4.78412857e+01, -4.94226074e+01, -4.03650360e+01],
         [-2.00031033e+01,  6.08664474e+01,  8.17405510e+00, ...,
          -4.89005280e+01, -5.90939636e+01, -4.14923592e+01],
         [-1.53922958e+02, -4.38242569e+01, -4.53684692e+01, ...,
          -7.21609192e+01, -6.14896317e+01, -3.65516281e+01]],

        [[-4.73735008e+01, -3.41962051e+01, -3.74608269e+01, ...,
          -7.45596504e+00, -7.31755733e+00, -1.60885124e+01],
         [-6.24234428e+01, -2.96515732e+01, -4.65041237e+01, ...,
          -4.72871256e+00, -2.03644466e+00, -9.75383663e+00],
         [-7.78091431e+01, -6.62882233e+01, -8.26859665e+01, ...,
          -7.36377258e+01, -4.45033646e+01, -4.27225037e+01],
         ...,
         [-5.21416435e+01, -4.79345245e+01, -1.94807243e+01, ...,
          -4.63317719e+01, -5.14390182e+01, -4.86955376e+01],
         [-5.49678001e+01, -4.29327850e+01, -1.45485783e+01, ...,
          -3.20624237e+01, -2.77655869e+01, -3.03304882e+01],
         [-3.63332634e+01, -5.35129395e+01, -2.23160210e+01, ...,
          -3.47856407e+01, -3.04427185e+01, -2.80112000e+01]],

        ...,

        [[-4.74601059e+01, -7.61016312e+01, -6.27142792e+01, ...,
          -5.15001526e+01, -1.97596245e+01,  1.56756973e+00],
         [-1.09927811e+02, -1.40803879e+02, -1.29083405e+02, ...,
          -9.53482056e+01, -1.30481453e+01,  1.54791842e+01],
         [-1.52028290e+02, -2.05058655e+02, -1.97106476e+02, ...,
          -1.51681152e+02, -3.56237297e+01,  1.12130127e+01],
         ...,
         [-8.74849091e+01, -4.64156952e+01, -1.48516827e+01, ...,
          -5.56459236e+01, -1.25644817e+01,  1.05311594e+01],
         [-8.36514206e+01, -5.47760010e+01, -1.75369740e+01, ...,
          -1.92452297e+01,  6.29400921e+00,  1.16010056e+01],
         [-8.55055695e+01, -6.86285858e+01, -3.49647751e+01, ...,
          -2.27549591e+01, -8.11953735e+00,  2.38107443e-01]],

        [[-7.85665161e+02, -8.74612976e+02, -9.88772461e+02, ...,
          -1.27541602e+03, -9.81773193e+02, -5.76246216e+02],
         [-1.26309900e+03, -1.26470850e+03, -1.29349731e+03, ...,
          -1.47686731e+03, -1.09906421e+03, -6.09180664e+02],
         [-1.78284009e+03, -1.69450464e+03, -1.49403320e+03, ...,
          -1.78028442e+03, -1.26287354e+03, -7.03716125e+02],
         ...,
         [-1.00871576e+03, -8.21046570e+02, -6.36620422e+02, ...,
          -9.28006348e+02, -7.18372314e+02, -4.14899475e+02],
         [-9.60229553e+02, -8.18582581e+02, -5.88664917e+02, ...,
          -6.90466431e+02, -5.43034790e+02, -3.17665497e+02],
         [-8.69738403e+02, -8.36209045e+02, -5.64757874e+02, ...,
          -5.97556946e+02, -4.59418213e+02, -2.51658508e+02]],

        [[-4.45263901e+01, -7.05552368e+01, -1.44238162e+00, ...,
          -3.45628738e+01, -5.43552780e+01, -4.13258972e+01],
         [-8.26740570e+01, -1.21586502e+02, -1.14394188e+01, ...,
          -5.72901840e+01, -7.67189178e+01, -5.92793922e+01],
         [-1.42641937e+02, -1.68532562e+02, -4.49021759e+01, ...,
          -9.04630585e+01, -7.94408722e+01, -5.09029770e+01],
         ...,
         [-9.37536774e+01, -6.21579819e+01,  3.14342213e+01, ...,
           3.28904057e+00, -1.52875957e+01, -4.29225874e+00],
         [-7.81461029e+01, -7.22118607e+01,  1.63341351e+01, ...,
           7.96173859e+00,  2.67618060e+00,  5.32587767e+00],
         [-6.89589844e+01, -4.00298271e+01, -2.01719403e-01, ...,
          -5.96850276e-01,  8.10801268e-01,  3.34924364e+00]]]],
      dtype=float32)}

 

above is the printout of my result.

0 Kudos
Reply