How to use an opencv function in a keras layer? Python

asked 2019-08-23 02:18:16 -0600

I would like to know how I can use a OpenCV function like Akaze inside of a Keras layer So the model would look like this

input
output1 = model_a(input)
opencv_output = opencv_layer(input)
merge_output = Concate(output1, opencv_output )(axis=-1)
.....

Any suggestions on how to do this will be appreciated. I dont want to do the preprocessing in the start as I am doing image augmentation and dont know how the image will change (rotate, flip ext). If you know a good way of doing this in the image augmentation method I would be open to hearing about it as well. Please and thank you.

edit retag flag offensive close merge delete

Comments

I can use a OpenCV function like Akaze inside of a Keras layer

why would you want to do that ?

why does it need to be part of the network (instead of being a "data preprocessing" step) ?

do you need gpu support for the underlying (tf ?) graph ?

berak gravatar imageberak ( 2019-08-27 03:47:38 -0600 )edit

It is because I am controlling which image is getting it done to

Guszilla gravatar imageGuszilla ( 2019-08-29 18:16:19 -0600 )edit