techxzen / hdrnet-mobile

A C++ implementation of hdrnet inference.
49 stars 11 forks source link

About the enhance quality #1

Closed peppaseven closed 5 years ago

peppaseven commented 6 years ago

Thanks for you great effort, I have tested you pre-trained model, I want to test this with google pixel2, how can I do this?

techxzen commented 6 years ago

Hi, the code is not completed yet, it will be built as a shared library in the future, which can be used by Android camera or an image processing application. So, it cannot run on google pixel2 yet. To test the enhance quality, I think you can take pictures using your pixel2, and copy to your computer, then use this codes. Or, if you have a tensorflow-gpu environment, you can use the hdrnet_legacy code, it will be faster because of gpu accelerated.

peppaseven commented 6 years ago

Thanks so much for you quickly reply, as i knew, it is not possible to use tensorflow lite because hdrnet uses custom layers, so, do you know how to implement this in android mobile? rewrite this with C++ or waiting for google new tflite? I am so interesting to that paper, and want to see result with Pixel mobile, how can I have other choice? could you share you schedule about when NDK code is ready?

techxzen commented 6 years ago

I think even the new tf-lite will not support the custom layers. In my plan, the NDK shared library will be ready in December. Then you can integrate the shared library into Android applications.

peppaseven commented 6 years ago

Wow, another thing, I test you code with Intel I7 CPU, it is running so low with 1fps, one frame need about 1.2s, could you kindly give some advice how to speed up? I want to see real-time video playback, so, I write a test sample for this,,

peppaseven commented 6 years ago

If you need, I can commit my test script with python, it can play any video within your main binary.

techxzen commented 6 years ago

Thanks. If you want to achieve real-time, I think GPU acceleration is a good choice. That needs to write CUDA or OpenCL code. Especially the HdrnetTask::apply_slicing_layer_and_assemble(...) takes much time, accelerating it will improve speed.

peppaseven commented 6 years ago

I provide a suggestion for your code,that mode directory should be set by external caller, not a static compile flag, if modify this, you can easily test all pre-trained models, no need compile every time.

techxzen commented 6 years ago

Thanks for your suggestion. The feature has been added now : )

peppaseven commented 6 years ago

thanks for your great work, I have compiled this with NDK, just under testing.