Code Monkey home page Code Monkey logo

Comments (3)

mbeytekin avatar mbeytekin commented on June 8, 2024

I made some changes in simswap.py and got better results:
soft_face_mask, _ = self.smooth_mask(face_mask)
img_white=soft_face_mask*255.
# Only take face area from the swapped image
swapped_img = swapped_img * soft_face_mask
swap_1280px-Happy_family_(1)

However, in some cases, overlaps can occur.
swap_family-of-four-7101-a234e9249b2c7223d4e4d8cd9432f9e9@1x

swap_happy-families-couple700x400

from simswap-inference-pytorch.

mike9251 avatar mike9251 commented on June 8, 2024

Hey @mbeytekin , you can blend faces separately. At the end of the simswap.py file do not sum img_mask and target_image, instead blend each crop independently.

I think a better solution would be computing intersection between crops and compensating it during the blend step. I'll take a look later.

from simswap-inference-pytorch.

mike9251 avatar mike9251 commented on June 8, 2024

Fixed the issue with the latest update

before

swap_before

After
swap_fix

from simswap-inference-pytorch.

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.