Page 1 of 1

Question about Phaze-A model scaling

Posted: Wed Sep 01, 2021 8:22 am
by Atticus

How is the scaling determined for the different Phaze-A models? I'm testing out models not included in keras, but not sure what to put for scaling or when to leave it blank. I see that "some models expect different scaling" I'm just not sure how to know. https://github.com/deepfakes/faceswap/b ... _a.py#L587


Re: Question about Phaze-A model scaling

Posted: Wed Sep 01, 2021 10:07 am
by torzdf

Ha! Your link just showed me a bug in my -1 to 1 scaling (now fixed), so thanks for that.

I just pulled this information from keras applications, for example this for efficientnet (https://www.tensorflow.org/api_docs/pyt ... cientNetB0):

Note: each Keras Application expects a specific kind of input preprocessing. For EfficientNet, input preprocessing is included as part of the model (as a Rescaling layer), and thus tf.keras.applications.efficientnet.preprocess_input is actually a pass-through function. EfficientNet models expect their inputs to be float tensors of pixels with values in the [0-255] range.

Faceswap, by default, normalizes to the 0-1 range, so when using encoders in an alternative numeric range, we need to change our inputs. For different encoders you will need to refer to the original code/documentation to see what numeric range is required, and what adjustments would need to be made.

As an aside, I would be very interested in seeing anything you are working on and results that it achieves.


Re: Question about Phaze-A model scaling

Posted: Wed Sep 01, 2021 5:57 pm
by Atticus

This is super helpful, thanks! I'll share any good or interesting results I come across.