Code Monkey home page Code Monkey logo

Comments (1)

ukaprch avatar ukaprch commented on August 19, 2024 1

I have Windows 10 and I was receiving problems as well with this module. I had to make more changes to make it work. This function is mixing datatypes so I had to make all arrays of type numpy float64 to make it consistent.

Starting with the function at line 217:
def blur_blending_cv2(im1, im2, mask):

mask = mask.astype(np.float64)         <===include this line
mask /= 255.                                       <===include this line
#mask *= 255.                                     <===comment out

kernel = np.ones((9, 9), np.float64)  #np.uint8)        <===modify this line
mask = cv2.erode(mask, kernel, iterations=3)

mask_blur = cv2.GaussianBlur(mask, (25, 25), 0)
mask_blur /= 255.

im2 = im2.astype(np.float64)               <===include this line
im = im1 * mask_blur + (1. - mask_blur) * im2

im /= 255.0
im = np.clip(im, 0.0, 1.0)

return im

Starting with line 433 I had to modify to:
blended = blur_blending_cv2(warped_back, blended, backward_mask)
#blended *= 255.0 <===comment out

    io.imsave(os.path.join(save_url, x), img_as_ubyte(blended)) # (blended / 255.0))     <=== modify

from bringing-old-photos-back-to-life.

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.