Code Monkey home page Code Monkey logo

Comments (5)

evonneng avatar evonneng commented on July 3, 2024 1

Hi Chris! Thanks for the suggestion!

In case this helps to unblock you, this is possible to do by passing in a reference image (e.g. if it's green or some image background) into this function:

image_bg: Optional[th.Tensor] = None,

for instance, if you wanted to add an image background, it would be something like this:

tmp = cv2.imread(f"<path/to/image>")
image_bg = th.zeros_like(tex_rec)
image_bg[:, :3, ...] = (
      th.from_numpy(tmp.transpose(2, 0, 1)).float().cuda().unsqueeze(0)
)

or if you wanted to make it a solid color, just fill image_bg with some RGB color. There will be some color calibration steps you will have to do to get it to match green (like inverting this white balancing function:

__DEFAULT_WB_SCALE: np.ndarray = np.array([1.05, 0.95, 1.45], dtype=np.float32)
) but this should be the general idea. Hope this helps for the time being!

from audio2photoreal.

diaojunxian avatar diaojunxian commented on July 3, 2024

tmp = cv2.imread(f"<path/to/image>")
image_bg = th.zeros_like(tex_rec)
image_bg[:, :3, ...] = (
th.from_numpy(tmp.transpose(2, 0, 1)).float().cuda().unsqueeze(0)
)

hi, @evonneng thanks for the explain.

I'd like to know what the tex_rec variable in your hint code means? How should I pass the parameters?

I actually want to replace the animated characters in the demo with images of myself, is it possible?

from audio2photoreal.

alexanderrichard avatar alexanderrichard commented on July 3, 2024

You unfortunately can not change identity of the avatars. Only the four pre-trained models are available.

from audio2photoreal.

diaojunxian avatar diaojunxian commented on July 3, 2024

You unfortunately can not change identity of the avatars. Only the four pre-trained models are available.

thanks a lot, and If I want change identity of the avatars, what should I can do ?

from audio2photoreal.

chrisbward avatar chrisbward commented on July 3, 2024

Closed as the guys above probably want to create new github issues to track

from audio2photoreal.

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.