Neural Style Transfer Tutorial with Tensorflow and Python in 10 Minutes

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 93

  • @daidraich
    @daidraich Рік тому +1

    Wow thank you so much!

  • @Andy-rq6rq
    @Andy-rq6rq 4 роки тому +5

    back at it again Nick, love the unique intros

    • @NicholasRenotte
      @NicholasRenotte  4 роки тому

      🤣 I never know if people like them but I lmao when i'm making them!

  • @ashleysami1640
    @ashleysami1640 4 роки тому +5

    Nick R, the next Monet 🧑🏾‍🎨

    • @NicholasRenotte
      @NicholasRenotte  4 роки тому +2

      🤣 painting is my passion *furiously paints portrait*

  • @joshcummins3916
    @joshcummins3916 3 роки тому +2

    Very straight forward and awesome brother. Can't wait to make some art with this.

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      Awesome!! Let me know how you go! Got some music generation vids planned as well!

  • @NoMercy8008
    @NoMercy8008 3 роки тому +9

    This is super super fascinating :D
    I love art, I love ML .. this is perfect

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +4

      Did you check out the projects video then come straight here? 🤗🤗 Definitely, I think there's so many sick applications for GANs, I only really just got my head around them this week when building the super res project. I think I've kinda got it down pat, ready to start building some sick stuff!!

    • @NoMercy8008
      @NoMercy8008 3 роки тому

      @@NicholasRenotte Yup, as soon as the projects video ended, I hurried over to this one like a madman :D
      As I said, I love ML, I love art, I love programming, so I really enjoy doing "generative/procedural art" and have done a couple of smaller creative coding projects with it in the past.
      And it constantly keeps blowing my mind what we can do with machine learning and AI in general, again for example this style transfer model is super interesting and fascinating to me :)

    • @funny11744
      @funny11744 3 роки тому +1

      Hi ! Do you kow some free software to increase the size of image obtained with NICK software without affecting the quality ?

    • @NoMercy8008
      @NoMercy8008 3 роки тому

      @@funny11744 There are ML super-resolution models that can be used to up-res an image, I think Nick is doing that kind of project more or less right now, so he might have a video about exactly that soon :)

    • @NoMercy8008
      @NoMercy8008 3 роки тому

      @@funny11744 In the meantime, there's also a project on github called image-super-resolution (ISR), you can check that out if you wanna take a little dive into that topic before Nick releases his video.

  • @LuddeWessen
    @LuddeWessen 2 роки тому +4

    Thank you for the demo, and code!
    You are very enthusiastic and inspiring!
    (I have spent hours tinkering with it.)
    It is amazing how these powerful things are available at our fingertips! When I started using NN:s 6 years ago, you had to script your caffee models in bash, on your own workstation, for days. And not reach very far, compared to today.

    • @5minupsc723
      @5minupsc723 7 місяців тому

      code is working ?
      I went through the github repository link but couldn't find code in the repository

  • @zbmadon
    @zbmadon 3 роки тому +3

    Hey Nicholas, is there a way to add multiple images to create a mash GAN artwork?

  • @noahorosw
    @noahorosw 2 роки тому +3

    Hi Nick! I just wanted to say this is so cool . I've always wished I could paint like Van Gough , and now I have like 50 brand new Masterpieces I just keep making more and more so cool . And I have so many pictures I've taken over the years with my drones from way up high and I haven't even tapped into those files yet . If you come up with anything new on this subject please make another video for all of us artist's so we can dive deeper into this , and create some serious real stuff . Like to take an image such as one we have created here . A profile picture with a Van Gough , and a deep learning code that will actually enhance , and beatify our finished image ? I don't know ? You are the master .

  • @newnewkidsontheblock
    @newnewkidsontheblock 3 роки тому +1

    What is the before steps to this? As far as actually trying to run this in Anaconda and Jupyter? So the images can import?

  • @creativebeetle
    @creativebeetle 3 роки тому +4

    Excellent video! Unfortunately I get an error "NameError: name 'load_image' is not defined" in the "content_image =" cell. Any idea as to why?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      Heya @Dennis, there was an error I made in the video. The function and function call should be load_image. Try out the baseline code: github.com/nicknochnack/Python-Neural-Style-Transfer/blob/main/Neural%20Style%20Transfer-Template.ipynb

  • @newmoneyideas
    @newmoneyideas 2 роки тому +2

    Video is good...pls also tell where you are writing this code..i mean software to write and execute the code.

  • @onetwo203
    @onetwo203 3 роки тому +1

    Top notch quality, keep going

  • @apristen
    @apristen 3 роки тому

    nice tutorial for total beginners without deep tech details :-)

  • @doudou3580
    @doudou3580 3 роки тому +1

    hi Nick! I followed your fantastic tutorial but was stuck in ‘ Loading a Neural Style Transfer model from Tensorflow Hub’. My program just could not run further and it's driving me crazy! I'm wondering if it's the Internet problem or the model itself. Lots of thanks.

  • @WingtoKwong
    @WingtoKwong 3 роки тому +2

    "stylized_image = model(tf.constant(content_image),tf.constant(style_image))[0]"
    this line it gave me a Unknowerror...and it told me that 'Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.'

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому

      Hmmm, this is normally a TF error. What version of TF are you running?

  • @im_yuri_24
    @im_yuri_24 Рік тому +1

    Hello, Nicholas! Help needed! You do a great job and I've used your notebook as a showcase and it was working fine just 2 weeks ago, but now something happened - I've got error message at step 2 - ValueError: Trying to load a model of incompatible/unknown type. How this can be?

    • @im_yuri_24
      @im_yuri_24 Рік тому

      In case someone meets same problem - check folder \AppData\Local\Temp\tfhub_modules - empty folders there block the model. Interesting, that in fact you can use 2 models = /magenta/arbitrary-image-stylization-v1-256/2 as in Nickolas's video or this /magenta/arbitrary-image-stylization-v1-256/1 - but they both can be blocked by matching empty folder in the folder, mentioned above. You need just delete empty folder and it will work

  • @esmatpoya
    @esmatpoya 3 роки тому +1

    for the last line of code I got error "stylizedimage
    can you please help me

  • @tracywang1
    @tracywang1 10 місяців тому

    Thanks for sharing
    I'm wondering how to train my own stylization model?
    Can you shaed some light on that? or is there resources to learn that?
    Thanks!

  • @waishingwong3208
    @waishingwong3208 3 роки тому +1

    Hi Nick! Thanks for the tutorial. What versions did you use for tensorflow and tensorflow_hub? I keep getting errors on my tensorflow_hub import (cannot import name 'Layer' from 'keras.engine') or (cannot import __version__ from keras).
    I tried changing my tensorflow version a few times, and I get an error on my tensorflow_hub import everytime.

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      For this, I think I was using TF 2.3.1 and Python 3.7.3, lmk how you go!

  • @kathib2571
    @kathib2571 3 роки тому +1

    can i use this code in google colab, too? or what has to be different there? i don´t know how to upload own pictures and so much more. what is the easiest solution to work with style transfer? thanks

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      Yep, you should be able to execute the same code in Colab!

  • @robotixIIIX2017
    @robotixIIIX2017 2 роки тому

    can u give link to site where we can do this?

  • @riis08
    @riis08 4 роки тому +2

    @Nicholas Renotte. Great video again... thanks... Is it possible that you can do this in Nodejs with realtime images??

    • @NicholasRenotte
      @NicholasRenotte  4 роки тому

      Thanks so much!! Yah, let me add it to the list.

    • @funny11744
      @funny11744 3 роки тому

      @@NicholasRenotte Hi Nick. I let you know that I solved the problems from ColabNotebook using Google drive for upload . So I erased my comment wit errors found for Colab Notebook . Thanks for support and for understanding.

  • @alexijohansen
    @alexijohansen 3 роки тому +1

    How does this handle the difference in resolution?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      Didn't read into it too much, but this is the paper behind it: arxiv.org/abs/1705.06830

  • @gareven
    @gareven 3 роки тому +1

    Can we get output image size bigger than 2000 x 2000 pixels?

  • @SpecialAgentOso
    @SpecialAgentOso Рік тому

    woah back up... what even is that page you're on? what am i supposed to install to get this going?

  • @vikashchand.
    @vikashchand. 4 роки тому +1

    If Bob Ross was a programmer 🔥😂
    Cool stuff man! 🤘

    • @NicholasRenotte
      @NicholasRenotte  4 роки тому +1

      🤣🤣 *in Bob Ross voice* "And now we're going to paint some happy little trees"

    • @vikashchand.
      @vikashchand. 4 роки тому +1

      😂😂

  • @allenwong9918
    @allenwong9918 3 роки тому +1

    how do i choose the image quality?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому

      I think you're kinda limited with this model, possibly look at using an alternate model would be my suggestion.

  • @ashitashetty1038
    @ashitashetty1038 3 роки тому +2

    Hi, this is a great video. How can we do the same for a video?

  • @Comegax
    @Comegax 3 роки тому

    Good day! I have been trying for a while now, but I don't seem to quite get this SSL URL Error "URLError: " any ideas on the fix?

  • @Revathi-hb9rs
    @Revathi-hb9rs 5 місяців тому

    sir,please provide the complete end to end neural network style transfer projects with web application

  • @MohamedAli-hh3qm
    @MohamedAli-hh3qm 4 роки тому +1

    What is your idea about quantum computing sir...

    • @NicholasRenotte
      @NicholasRenotte  4 роки тому +1

      That it's AWESOME! I haven't done anything yet but I work pretty closely with some of the team that uses this www.ibm.com/quantum-computing/ hoping to do a video on it soon!

  • @martinkaiser5263
    @martinkaiser5263 3 роки тому +1

    Can i run this on Windows 10 ? Because i have a RTX 2080 TI only available on windows . And how to do it ? Have Anaconda installed

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      Definitely, you should be able to open a Jupyter Notebook, pip install any packages you need, and run the code: github.com/nicknochnack/Python-Neural-Style-Transfer

    • @martinkaiser5263
      @martinkaiser5263 3 роки тому +1

      @@NicholasRenotte Which packages do i need and wich version ?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому +1

      @@martinkaiser5263 for this run through you'll need tensorflow, tensorflow_hub, matplotlib, numpy and OpenCV (aka cv2).

    • @brunohuf9016
      @brunohuf9016 3 роки тому

      your code worked?

    • @martinkaiser5263
      @martinkaiser5263 3 роки тому +2

      @@brunohuf9016 I set up Ubuntu 20.04 on a external SSD and doing all this stuff in Ubuntu and it works great

  • @funny11744
    @funny11744 3 роки тому +1

    Hi Nick. A kindly request and question : how to increase the size of stylized_image to 1or 2 MB at least, without affecting the quality of image ? The stylized_image is very small. Maybe you can find a solution to add some codes to this software , or please mention few free of charge Photo editing software . Many thanks.

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому

      Would likely require a rearchitect of the model as far as I understand @Costache Bicu. Definitely possible to do though.

    • @funny11744
      @funny11744 3 роки тому +1

      @@NicholasRenotte Sorry for trouble Nick, I hardly wait your next video to increase (improve) the quality of result in order to use that software in place of basic image filters- very boring as you mentioned. I have important plans using that technique , please help to improve the quality- the size of image. thanks

  • @faraheldeshnawy1202
    @faraheldeshnawy1202 3 роки тому +1

    stylized_image = model(tf.constant(content_image),tf.constant(style_image))[0]"
    this line it gave me a key and type error I am using TF 2.0

  • @_ept_
    @_ept_ 2 роки тому

    Thanks, it's so just and beautiful

  • @saichowdhury7294
    @saichowdhury7294 2 роки тому

    Import tensorflow_hub as hub(there I got module error

  • @hazel3899
    @hazel3899 3 роки тому

    Hopefully you're still checking comments on this! ;) i get this error when trying to call the image "Error! is not UTF-8 encoded" - looking for solutions on stackoverflow but no luck so far

  • @iammayurn
    @iammayurn 3 роки тому

    How to part 2 of this video optimization and gradient descent.

  • @iammayurn
    @iammayurn 3 роки тому

    Why we need channel 3 and dtype flot32?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому

      It's part of the requirement for the model inputs!

  • @syahrulhidayatullah9666
    @syahrulhidayatullah9666 4 роки тому +1

    hi sir, why i cant install a tensorflow on python 3.9?

    • @NicholasRenotte
      @NicholasRenotte  4 роки тому

      Doesn't look like it's supported yet www.tensorflow.org/install/pip, try 3.8.x!

  • @ATHARVA89
    @ATHARVA89 2 роки тому

    Nick if you could zoom in a bit from next time !!! great tutorial

  • @thicccrusade2302
    @thicccrusade2302 2 роки тому +1

    Whole thing is broken, nothing is defined. No idea what's going on..
    EDIT:
    Ok, now it's working, had to pip install some packages..
    pip install tensorflow
    pip install tensorflow-hub
    pip install matplotlib
    pip install numpy
    pip install opencv-python

  • @Moctop
    @Moctop 3 роки тому

    Seems it uses vegetation and water to draw the portrait simply because it was in the reference...vegetation and water isn't the "style". It should look at the brush strokes, palette use, not copy the colors straight off. It's a big ask, I know.

  • @bashirmanafikhi
    @bashirmanafikhi 2 роки тому

    wow that's great thanks

  • @muditrustagi5775
    @muditrustagi5775 3 роки тому +1

    wowowowow superrrrrrr

  • @anticipate_tv
    @anticipate_tv 3 роки тому

    legend

  • @ezequielaguilera130
    @ezequielaguilera130 3 роки тому +1

    can load more than 1 image ?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому

      Haven't tested it @Ezequiel Aguilera

    • @funny11744
      @funny11744 3 роки тому

      @@NicholasRenotte Does the software work with bigger file size? 1 or 2 MB photos ?

    • @NicholasRenotte
      @NicholasRenotte  3 роки тому

      @@funny11744 I think it scales them down when transforming. I haven't tried anything that big tbh.