how to import lstm net in opencv?

asked 2019-07-11 03:47:03 -0600

updated 2019-07-11 04:25:13 -0600

berak gravatar image
System information (version)
  • OpenCV => 4.1
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2015

Detailed description:

I want to use LSTM network to classify sequence data in OpenCV, but I have seen many tutorials are image classification. The general way is to use Imread to read the image first, use blobFromImage/blobFromImages to convert the image to blob, then pass the blob. Into the network forward. My problem is that the LSTM network input is not an image, it is a sequence of data, 1024*nImages variable size input data, how to pass into the network for forward?

edit retag flag offensive close merge delete

Comments

opencv's dnn can only process pre-trained networks, so you must have a serialized model from some other ml framework (e.g. tf) , no ?

It is a sequence of data, 1024*nImages variable size input data,

can you elaborate ?

berak gravatar imageberak ( 2019-07-11 04:22:56 -0600 )edit

I have trained the LSTM network in matlab and successfully exported it to the onnx model. The LSTM network input is sequence characteristic data of 1024*nImages, and the output is 8 categories.An example of a similar classification problem is here. My model network structure can be seen here: [https://drive.google.com/open?id=1N6S...] But I don't know how to use LSTM network in opencv, that is, I don't know how to input data format to LSTM?

cuixing gravatar imagecuixing ( 2019-07-11 21:05:48 -0600 )edit