intel / webml-polyfill

Deprecated, the Web Neural Network Polyfill project has been moved to https://github.com/webmachinelearning/webnn-polyfill
Apache License 2.0
161 stars 42 forks source link

[Example] image super-resolution #253

Closed GreyZzzzzzXh closed 5 years ago

huningxin commented 5 years ago

@GreyZzzzzzXh , SRGAN might be interested by you.

GreyZzzzzzXh commented 5 years ago

@huningxin ,yes SRGAN is in my consideration and i'll try it in the future. This project is a good reference, thanks!

GreyZzzzzzXh commented 5 years ago
  1. I trained the SRGAN model on DIV2K dataset using tensorlayer. Reference: tensorlayer/srgan

  2. The generator of SRGAN is called SRResNet, being like this. screenshot from 2018-12-12 12-27-12 We can achieve a 4x upscaling. According to the origin paper, set B=16.

  3. SRResNet uses operation PixelShuffler(DepthToSpace) which is not supported in tflite yet, see TfLite buildin ops. So i use transpose + batchToSpace + transpose instead. New ops we need: transpose, batchToSpace, tanh

  4. A simple image demo with WebGL backend. input size [96, 96, 3] => output size [384, 384, 3] It takes several seconds to infer now. screenshot from 2018-12-12 13-56-26 Visit https://greyzzzzzzxh.github.io/webml-examples/index.html to test.

huningxin commented 5 years ago

Very nice! We need to investigate the platform API support for the three new ops. BTW, the link doesn't work for me. Would you mind to double check it?

GreyZzzzzzXh commented 5 years ago

the link doesn't work

updated it.

huningxin commented 5 years ago

The link works, however it reports WebGL backend failure to me. Did I miss any thing?

GreyZzzzzzXh commented 5 years ago

Is there any error or warning? I can get results on linux and android via this link.

huningxin commented 5 years ago

The failure disappears now. It's super (for super resolution). 👍

huningxin commented 5 years ago

OpenVINO pre-trained models also contains a SR model (https://software.intel.com/en-us/openvino-toolkit/documentation/pretrained-models). Please take a look.

GreyZzzzzzXh commented 5 years ago

screenshot from 2018-12-29 16-37-08

I trained FSRCNN, a small network for super resolution.

New ops we need: sigmoid, maximum, tanh, transpose_conv

Simple image demo with WebGL backend:

screenshot from 2018-12-29 16-44-12

Reference: Accelerating the Super-Resolution Convolutional Neural Network

Visit https://greyzzzzzzxh.github.io/webml-examples/index.html to test.

ibelem commented 5 years ago

Move to Feb 2019 milestone for this issue.