Skip to main content

Artist got automated

Here is my first Tensorflow run to convert images to different styles of famous painters

I am using the code that is available at https://github.com/lengstrom/fast-style-transfer

It uses specific versions of below libraries
!apt install ffmpeg
!pip install tensorflow==0.12.1
!pip install numpy==1.11.2
!pip install scipy==0.18.1
!pip install pillow==3.4.2
I started with latest version and that triggered failure after failure.

If you are like me, add below changes to their respective files


#This is to make tensorflow behave as if it is in v1
File : evaluate.py and ./src/transform.py
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()




#Image functions are removed from scipy.misc module. so use imageio instead
import imageio
scipy.misc.imsave(out_path, img) --> imageio.imwrite(out_path, img)
img = scipy.misc.imread(src, mode='RGB') --> img = imageio.imread(src, pilmode='RGB')


Refer this post on more details on imageio changes

Here is the original image and after style changes











Comments

Popular posts from this blog

Investing in Gold

Like many, I keep hearing about looming recession and Gold as a hedge. But how exactly gold is going to help me and if yes, how to invest is something running behind my mind.  So here is my work on it and hope it helps you too. Why Invest in Gold ?  Fiat currency we are holding is loosing its value at the rate of inflation. But before fiat currency, gold is the standard. Based on current technology, its difficult to extract gold. so in the demand vs supply equation, supply cant balloon like central banks printing money at their will. so i dont need to worry about Gold loosing its value over time. On Supply part, As per World Gold Council estimate 190,040 metric tones extracted and another 54000 metric can be extracted from ground. Refer :  https://www.gold.org/about-gold/gold-supply/gold-mining/how-much-gold On the Demand part, Below are the key drivers of Gold demand Source: Thomson Reuters GFMS, World Gold Council As an investment, From individu...

Upa Yoga

Pakistan

Watching recent tweets and news article in western media, I would like to spend some quality time and understand the enmity between India and Pakistan. In this pursuit, some interesting reads and my take a ways India-Pakistan partition - Birth of a country based on religion  Subsequent incidents Current states 9/11 Terrorist attacks and Intelligence war What wrong with Islam State of Pakistan and reasons for some of its troubles by a Pakistani 10-September - 2019 Pakistan Army begins operation in POK