GithubHelp home page GithubHelp logo

Comments (6)

yoyo-nb avatar yoyo-nb commented on May 27, 2024

out_dict['contribution_maps'] represents the contribution region of each TPS to optical flow

something like this:
image

out_dict['deformation'] is the optical flow
out_dict['occlusion_map'] is the Multi-resolution Occlusion Masks mentioned in the paper

out_dict['deformed_source'] is the deformed source_ image before using the inpaint module

from thin-plate-spline-motion-model.

instant-high avatar instant-high commented on May 27, 2024

Ok. I had tried that but trying to convert it to display or write it into video file I've got error message. Something like "out_dict has no deformed source image" if I remember correctly.
If it was not that thing, how to transpose?

Maybe you can help me?
I would like to try if my face swap mod is still working then but waý faster.
Using face parsing for masking I get ~ 2.it/sec now

from thin-plate-spline-motion-model.

yoyo-nb avatar yoyo-nb commented on May 27, 2024

sorry i said wrong

out_dict['deformed_source'] is not the deformed source_ image before using the inpaint module, it's just the source_image deformed by each TPS.

What you need is here

from thin-plate-spline-motion-model.

instant-high avatar instant-high commented on May 27, 2024

Yes, that is working.
So the deformed source image is not output of the dense motion script? I mean, I can not skip the whole inpaint module?
Line 91 in demo.py
out = inpainting_network(source, dense_motion)

Sorry for asking again

from thin-plate-spline-motion-model.

yoyo-nb avatar yoyo-nb commented on May 27, 2024

you can try this:

def deform_input(inp, deformation):
    _, h_old, w_old, _ = deformation.shape
    _, _, h, w = inp.shape
    if h_old != h or w_old != w:
        deformation = deformation.permute(0, 3, 1, 2)
        deformation = F.interpolate(deformation, size=(h, w), mode='bilinear', align_corners=True)
        deformation = deformation.permute(0, 2, 3, 1)
    return F.grid_sample(inp, deformation,align_corners=True)

# ............
# demo.py, Line 88
dense_motion = dense_motion_network(source_image=source, kp_driving=kp_norm,
                                                    kp_source=kp_source, bg_param = None, 
                                                    dropout_flag = False)
deformation = dense_motion['deformation']
deformed_source = deform_input(source, deformation)  # deformed source_ image before using the inpaint module

from thin-plate-spline-motion-model.

instant-high avatar instant-high commented on May 27, 2024

that is working so far but giving some strange/funny results. But faster....

I think I keep my hands off from changing this part.
The results of your original demo code are very good.

Thanks a lot

from thin-plate-spline-motion-model.

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.