GithubHelp home page GithubHelp logo

Comments (3)

titu1994 avatar titu1994 commented on July 17, 2024

There's been some issue to get color preservation working once scipy stopped supporting imread and imsave. I'd suggest going down to a version which uses older scipy and perform colorization post training

from neural-style-transfer.

sipie800 avatar sipie800 commented on July 17, 2024

I encounter this too.Win10 tensorflow 2.3 and Keras 2.4.3 and all latest version required libraries.
Finally figured out that this is due to some glitch on conversion between rgb and ycbcr and also between uint8 and float64,
and al the same for working around among PIL,skimage,imageio.
It's not a wise choose to fix all the glitches one by one because those libraries are not designed to work together in a decent way.
Get it solved by removing all implementation using PIL,imageio and skimage.All of these will be done by cv2 only.
And also conversion between RGB and BGR is done by cv2 rather than x=x[:,:,::-1], which just in some case, can cause unexpected result where you never imagine to be.

from neural-style-transfer.

HitLuca avatar HitLuca commented on July 17, 2024

I know I'm late to the party, but to fix it you can update the fromimage function in utils.py from

def fromimage(img, mode="RGB"):
    if mode == "RGB":
        img = color.lab2rgb(img)
    else:
        img = color.rgb2lab(img)
    return img

to

def fromimage(img, mode="RGB"):
    return np.array(img.convert(mode))

as a bonus you don't need the scikit-image library anymore since it's used only for that from what I could see

from neural-style-transfer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.