Skip to content

Make dreamify.py more resilient to input image files #12

@alextz

Description

@alextz

Make the input image's numpy array the right format for preprocess() by adding a conversion to RGB in the image read statement:

img = np.float32(PIL.Image.open(sys.argv[1]).convert('RGB'))

Otherwise, it's pretty easy to find JPG or other types of files that crash the script.

It might be less trouble for a user if the image write format were left to PIL to intuit from the output file name's extension, too.

(Hope this is readable. Browser not supported by github.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions