Zheng222 / IDN-Caffe

Caffe implementation of "Fast and Accurate Single Image Super-Resolution via Information Distillation Network" (CVPR 2018)
118 stars 25 forks source link

Does this model supports opencv dnn inference module? #11

Closed ghimiredhikura closed 6 years ago

ghimiredhikura commented 6 years ago

Thank you @Zheng222 for this wonderful work.

I am trying to use opencv dnn inference module for your SR method. I will be grateful if you can explain these lines of code in your IDN-Caffe/test/test_IDN.m file.

   im_input=permute(im_l,[2,1,3]);
    net.blobs('data').reshape([size(im_input),1,1]);
    net.reshape();
    net.blobs('data').set_data(im_input); 
    net.forward_prefilled();
    im_result=net.blobs('upsample').get_data();

    im_h=im_result'+mycrop(im_b,up_scale);
    time_idn(i)=toc;

Best, Deepak

Zheng222 commented 6 years ago

@ghimiredhikura Hello, the above code segment indicates that preparing the input image first and then sent it to the network. It is a basic operation in MatCaffe, I recommend you learn the official guidance of matcaffe. If you are familiar with pytorch, you can reference a third party implementation of IDN.

ghimiredhikura commented 6 years ago

Thank you @Zheng222 . Actually I successfully reproduce results in using opencv dnn.