'Extract style of an patch to find similar region using variational autoencoder

I have a very large resolution image and have to select a specific style from that image (a patch) and finally search for that selected style (the patch) in the whole image (the image have the same style similarity on multiple places). For this case, I have to use a variational autoencoder. But as far I have learned Variational autoencoder is a generative model, It's mainly regenerate images. So I am confused about how to extract the style feature of an image using variational autoencoder.

I have already created many overlapping patches of that large image and trained variational autoencoder using those patches and it is also able to regenerate the patches.

For example: [1]: Large Image: https://i.stack.imgur.com/JQKI4.jpg

[2]: An example patch of that image https://i.stack.imgur.com/plyqk.png

[3]: Marked similar style of that patch in the large image https://i.stack.imgur.com/s4yo8.png

Let's say this is a very high-resolution sky image that has style similarity in multiple places within the image. I have created many sliding overlapping patches of different sections of this image and trained a variational autoencoder to regenerate the patches. But I have to extract the style feature or style vector of those patches and then select a specific patch finally search the whole image to identify the style similarity locations of that image. I have to use style similarity instead of content similarity and variational autoencoder.

So my question is How to extract the style feature of an image using a variational autoencoder.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source