Giter Site home page Giter Site logo

Comments (12)

dfaker avatar dfaker commented on August 10, 2024

@Clorr, sorry for the delay, Yes this sounds good. Were you thinking about merging in just the enlarged model, the alpha masking, or the full warping stuff?

This cross-cuts so many of the modules and at the same time is incompatible with the expected input "shapes" of the existing modes. Do you think it fits well with the current plugin system or a interface based refactor with modules broadcasting their input and output shapes makes sense?

from df.

Clorr avatar Clorr commented on August 10, 2024

Hey no problem, glad to hear again from you!

I started the integration in deepfakes/faceswap#271 , however I did not started converting so I hope it is still doable ;-)

Reading alignments.json+cropped was a bit of a pain and should still be refactored a bit. I thought I could do a new Extract plugin with the code in your utils.py but the numpy.dstack outputs something I can't save as an image file.... so it is in a specific TrainingDatagenerator that loads images and does this preprocessing.

Maybe you can help me here, because if we can generate a savable/loadable image from that code I would prefer so that we can save time on train start and also check that data passed to trainer is correct.

For the convert I wanted to start it today, so for now i don't have a specific question. If you have some time to check my draft PR, I would highly appreciate ;-)

from df.

dfaker avatar dfaker commented on August 10, 2024

You mean being able to read in a set of images that match the output type of load_image to speed up initialization? They could be saved as png format and loaded back in with:

cv2.imread("image.png", cv2.IMREAD_UNCHANGED)

when viewed the images would look like disembodied faces due to the alpha masking but I suppose that's accurate!

Or there's always np.save/np.load on the array but that loses the benefit of being able to visually inspect them.

from df.

Clorr avatar Clorr commented on August 10, 2024

In one word: Awesome! I don't know if it is hard to modify extract to save pngs in the proper format, but it sounds simple... (And yes I prefer we have a visualizable image)

I'm mostly done for the 1st draft of convert. Have you noticed something else?

from df.

dfaker avatar dfaker commented on August 10, 2024

The pngs just need to be in order BGRA which they are already coming out of your load_image.

The training and image extraction looks fine as far as I can see.

from df.

Clorr avatar Clorr commented on August 10, 2024

Ok, if you see what's to be done, feel free to push something ;-) Otherwise I will try later on. For now I pushed a convert so you can have a look...

Result is a bit rough, but I trained for just a couple of minutes :-D
face3

Note that your model files are still compatible if you want to try...

from df.

dfaker avatar dfaker commented on August 10, 2024

Very cool, looks like you're not using the alpha output of the network?

I'll dig some old models out and give it a go a go when I'm back at my dev machine.

from df.

Clorr avatar Clorr commented on August 10, 2024

Hmm, not sure, maybe I missed something. There was some dead code because transfer_avg_colorwas not used and even here in the repo i can't find a ref to it. So there is possibly a problem...
Note that I used convert_face_larger and not the code from convert_face_video

from df.

dfaker avatar dfaker commented on August 10, 2024

Nah, transfer_avg_color is genuinely not used.

Looks like a perfectly square bounding box, the network should output two images, an RGB face and a B/W alpha channel (new_face_m then transformed into image_mask) which should restrict the area output to just the core face avoiding changing the areas outside the face.

The code in Convert_DFaker looks fine at a glance though, it could be that it's just the short training causing it.

from df.

Clorr avatar Clorr commented on August 10, 2024

Do you have any theoritical background behind your model? Is there any related paper that I could read about?

from df.

dfaker avatar dfaker commented on August 10, 2024

Not really, it's all trial, error and experimentation other than the core AE pattern from deepfakes and the residual block function from shaoanlu.

from df.

dfaker avatar dfaker commented on August 10, 2024

Closing for now as the discussion is much more lively over on the PR

from df.

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.