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...

Why Chiru?

I don't want to say Chiru will do wonders. But he is not mastered in looting the people like others. He is not an experienced Politician .Its a great Qualification. One of my friend raised an objection here saying that " being in-experienced politican how its going to be a great qualification and do you thinking that all current politicans are bad" i am accepting his comments and removing a few words from my article.... He is a new comer into this field, so by the time he learns how to do all these things, it will take some time. As a fresher, he will may try to do some thing good for till he get defeated. By the track record of Chiru, i don't think, he will get defeated. Just because he became No.1 in a field which similarly ruled on the base of caste. But he conquered it not just with Charishma and acting. He know how to win. Another comment is how chiru's past track record in Movie field will guarentee success in completely different "Political field...

Upa Yoga