divyanshu092 / Photorealistic_Style_Transfer

Deeper Understanding and Modifications proposed to the High-Resolution Network for Photorealistic Style Transfer
MIT License
7 stars 2 forks source link

Run on Mobile? #1

Open InternetMaster1 opened 4 years ago

InternetMaster1 commented 4 years ago

Amazing Library!

Can this run on a mobile device, say Android?

divyanshu092 commented 4 years ago

Hi, Yes, this project is based on Google Colab so it can be run on any device. You should first mount your google drive, then clone this repo and go to the project's Code folder and run the Photorealistic.ipynb. You can follow this article for cloning the repo on your google drive: https://medium.com/@ashwindesilva/how-to-use-google-colaboratory-to-clone-a-github-repository-e07cf8d3d22b

InternetMaster1 commented 4 years ago

Thanks for the quick reply.

1) I meant, can I run on Android on a Mobile GPU similar to this library : https://www.tensorflow.org/lite/models/style_transfer/overview I would have to convert the model files to tflite?

2) What is the execution time for the style transfer and the size of the quantized mode? If you check the above link, there is a table at the bottom which gives the performance benchmarks for Google's implementation. image

How does photorealistic style transfer compare?

3) The Google Style Transfer library's output creates a lot of distortions. If I take a human face as a content image and apply style transfer, it shows a lot of wrinkles on the face. Your library would give better results?

divyanshu092 commented 4 years ago

Hello, I don't have much idea regarding how this would run on Mobile GPU, but with the advent of Pytorch Mobile, it might be possible to deploy any Pytorch model to both Android and IOS. The comparison would make sense when we actually deploy on mobile GPU. As of now, I am using Google Colab and the algorithm is an iterative one which improves over time. However, good results take time in the order of minutes.

If I take a human face as content image and apply photorealistic style transfer, the wrinkles/distortions highly depend on the style to which we are wishing to transfer. I would attach a few examples, so you can compare.

divyanshu092 commented 4 years ago

It also requires some changes in the hyper-parameters while testing on human faces giving more weight to content. I am attaching a content image, some style images and the photorealistic style transfer result images.

person2 pen_portrait person2_pen_portrait Van-Gogh person2_Van-gogh Vassily person2_Vassily