New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Original Model 128 worth it? #385
Comments
Post results eventually. Something like a short clip before and after. So we can judge if it's worth it? I think the main problem isn't the resolution, but the averaging. |
Sure I will. I don't fully understand the theory though a highres data-set may contain more details for reconstruction (and more face coverage as well). I also work on idea if a concatenated Conv2d tensors with different kernels could preserve facial features such as wrinkles, freckles, and moles. |
You can share out, and we run again to try. |
Yeah, I think it's worth it. If you can add a new model, then choice is good. If it's in a state you can share, then please raise a Pull Request so others can test. Thanks 👍 |
I'm willing to test it. Is the Dfaker plugin/model still planned for integration at some point? I can run the Original model with no issues, but can't get the proposed Dfaker code here to work. |
@andenixa we can test it, i believe 1080TI can support your request. |
@torzdf yes its in in a state which I can share it. The major issue is to see if it has any meaningful results and since 128 models train longer I am still looking if it can perform at the level of Original quality-wise. At this stage it learns rather well but decoder part significantly lags behind the encoder and I can't predict its limitations. |
Excellent. Well, whenever your ready, please raise a PR pointing at the Staging branch. Thanks! |
@torzdf |
Still tuning the Net. Memory consumption is modest even for middle-level cards. Speed is quite good, but I can't get a crisp picture even for decoder. |
I'm not trying to nitpick but is conversion not possible with this model? I've tried adding the "-t OriginalHighRes" on the conversion code but it's not working. It says: Was this commit only meant for training as of now? |
@tjdwo13579 you might be right I have forgotten to add conversion code. I did a PR yet I weren't able to test it with the latest git version. |
@andenixa Thanks for adding the conversion code! I'll try it out now. |
@iperov I shall try your interleaved Upscale/ResBlock approach on decoder if you don't mind. I also like the face extractor you are using. I want to create something akin to H128 yet maskless. I noticed you reduce memory consumption by using smaller batch sizes. Does it play well for diverse (different lighting condition) data-sets? I noticed bugger batches contribute to more accurate / generalized models. I wasn't able to refine anything with bs < ~45-48 |
@iperov looks excellent. Do you think its possible to preserve TARGET faces details, freckles, perhaps through another special layer? Do you feel that additional conv layers (for Encoder) contribute to better detail preservation? I also want to try deep-deep approach with additional Dense+Dropout layer in the middle of Encoder. |
@andenixa model experiments with result comparison are much welcome. |
Thanks to @iperov I am currently testing another revision of HighRes model adopting their re-scaling idea. |
I'll leave it open as a pr for now. Let me know when you think it's ready for merging. |
@torzdf sure, I am just trying to see if its not worse than the previous one considering decreased learning speed and raised memory demands. I am also trying a sliced bread design with dropout layer in the middle because previous 64x model (which is the basis for HighResv2) overtrained because of increased number of Conv2D layers. |
Still working on the model. The clarity is fascinating now, but the target vectors sometimes match wrongly aligned faces. I am trying to reduce number of deep layers to see if it helps that but I shall leave the high clarity (very-deep) Encoder in the code as well for those who want to experiment. |
@torzdf I've updated my PR for the new model. It seems to be rather sane and stable. It takes some time to train and resource consumption is around 5gb per 24 batch_size. The clarity is rather good with a nice data-set. It seems to work for multi-gpu model as well. |
@andenixa is SeparableConv useful ? what benefits it provides? have you comparison against regular idea with residual layers ? |
@iperov I think its slightly faster and less accurate with colors as it processes color layers separately (presumably sequentially). It consumes less memory though it probably has worse convergence in general. I try to squeeze more layers while having reasonable training speed and Ram requirements. Also ideally the first conv layers it has to be 2x the retina side size yet I think it's unfeasible with Conv2D memory wise. PS: The reason I can't use OpenFaceSwap it's not compatible with current training sets and I have a lot of manually crafted sets. |
Ok, I haven't got time to test this at the moment, but I will merge it into staging. If anyone wants to checkout the staging branch, give it a go and report back their findings that would be appreciated. |
@andenixa I made best H128, without suxx residual blocks. I removed res blocks from all models. New super update for all models upcoming... |
@iperov sounds fascinating if you can make it happen. In fact perhaps we should aim for H256 next. I very excited to give your H128 a try just need a time to time to make a training set. Are H128 considerably different from full-face? For regular faceswap its just a matter of adjusting the margin matrix and of course training it to catch more "space". I actually changed new HighRes model to cover most of the face which is going to be in the next revision. |
H128 has more details vs full face 128, but doesnt cover one cheek and beard. |
@iperov I am not exactly aiming to create fakes but rather to have one-to-many model where I merge multiple faces in the target data-set to catch unique features of each face. I have been successful with the basic Model by adding extra Conv layer(s) and increasing neuron count at dense layers. The problem of poor generalization and over-fitting still persists. It needs some learning rate decay and a lot of training epochs and still sucks quality-wise. |
then what you doing in face swap repo ? |
@iperov faceswap serves my purpose to some extent. It also doesn't have any working 128 model thus though I could provide one. Still not sure if my "concoction" works good enough (though its gotten much better now). Perhaps you could donate some of your code to create a basic H128 with decent quality and speed for faceswap repo. |
hmn, latest push still says OOM in both modes, even with batch size 2 on GTX 1060 6Gb |
@tjess78 I think you have to checkout the andenixa-patch-1 branch |
I tested it. Seems to be learning rather well both performance and quality-wise. |
@andenixa Thank you |
|
Narf, I don't get it. No matter what I do, it will not run on my 1060 6GB. Exception in thread Thread-1: |
@tjess78 seems to be a genuine OOM. What batch size do you use and are there any other programs that use video memory are running in the background? |
People who are short on vram can adjust the settings.
I trained up to 100k with it(-bs 8). the quality is still better than the original 64. The speed is also acceptable. |
can any one integrate Iperov DeepFacelab to here? Because i think Deepfakes master here should include all kind of faceswap model study . i not sure what will be the different but , i hope master here can include all different deepfakes model such as DFaker, original model, low memory model , LIAEF128YAW (5GB+) |
Since it's open source, I suppose anyone, with proper credit given, can port Iperov ideas here. But don't expect him to help. |
@ruah1984 I don't want do put you off as we might actually port some of these models eventually. @Kirin-kun Iperov says he doesn't mind if some of his work is to be ported to faceswap. I actually asked his permission twice and he said I don't need his permission. |
I have been try his work. And result looks good .Just hope if we have gui version and put all together inside here as a team. |
As @andenixa says. Anyone is welcome to open a PR to port other models. |
TypeError: join() argument must be str or bytes, not 'PosixPath' |
other mode is fine |
Should be fixed in latest commit. |
I tested OriginalHighres with a small dataset and it looks really good. The faces are more detailed and have more depth/defined features than with Original. A few differences:
In then end, the only caveats are the pupils that look a little too like lifeless gray circles, in Original, they are more black so it's less visible. And eventually the smiles showing teeth that look blurred, but I will see if it improves after training more. Overall, I'm really satisfied with this model. It might become my preferred model. And its memory management is amazing. With a GTX 1060 6gb, I can manage a batch size of 16 |
@Kirin-kun thank you for your feedback. I think we essentially would need to add mask for eyes to work. |
For the moment, I'm not doing videos. I use photos as source material. It's a lot better looking than flickering videos and it's possible to adjust convert parameters easier than with a video with thousands of frames with different zooming on the faces. I tried to do videos, but I had mixed results (with just about all models). In the end, still pictures of models posing gives the best visually seamless faceswap. I trained more on the same dataset, from 130k to 150k iterations, and the changes are really minute on the converted faces. When comparing, the differences are barely visible. Further improvements I see are, eventually, the pupils looking more lifelike and also a way to handle, at convert time, the obstacles, like glasses, hair, hand, hats, etc, that cover parts of the destination face. |
Closed as OriginalHiRes is implemented. @andenixa feel free to open new issues for your new models. |
I have created a rough version of Original Model with dimensions 128, 128, 3.
Rationale:
There seems to be increasing demand for HD face-swapping while none had any luck with GAN128 as far as I can tell from issue and the playground. In addition it could also cover more face area.
Is releasing Original128 worth it? Still assessing the efficiency. I had to sacrifice some color data to keep up with memory / speed limitations but overally its not very visible (as opposed to GAN128 that discards
original color data). Speed seems to be up to snuff. Trying one-to-many scenarios as well. No LowMem version probably will ever be created for that.
Could also do Orig256 and Orig512 but definably won't fit in consumer GPU RAM.
--cheers
The text was updated successfully, but these errors were encountered: