[Guide] macOS Install Guide: Installer Method

Installing and setting up FaceSwap


Forum rules

Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.

User avatar
Mawkins
Posts: 4
Joined: Sun May 12, 2024 4:03 pm
Answers: 0

Re: [Guide] macOS Install Guide: Installer Method

Post by Mawkins »

Also if you could please advise what I should do now, I would very much appreciate it, should I install the Tensorflow plugin somehow?

User avatar
torzdf
Posts: 2796
Joined: Fri Jul 12, 2019 12:53 am
Answers: 160
Has thanked: 142 times
Been thanked: 650 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

I do not know why it did not install, it definitely should have. The following should get it working for you.

Open up a terminal and enter the following:

Code: Select all

conda activate faceswap
pip install tensorflow-metal==0.6.0 decorator cloudpickle

(Those last 2 also did not install for you, but there is no output in the log as to why this failed. Hopefully it was a temporary network issue)

Last edited by torzdf on Thu May 16, 2024 10:41 am, edited 1 time in total.

My word is final

User avatar
kasuo
Posts: 1
Joined: Sun Nov 10, 2024 9:32 am
Answers: 0

Re: [Guide] macOS Install Guide: Installer Method

Post by kasuo »

Code: Select all

(faceswap)  python3 faceswap.py gui

Setting Faceswap backend to APPLE_SILICON
Traceback (most recent call last):
  File "/Users/qiasuo/faceswap/faceswap.py", line 12, in <module>
    from lib.cli import args as cli_args  # pylint:disable=wrong-import-position
  File "/Users/qiasuo/faceswap/lib/cli/args.py", line 19, in <module>
    _GPUS = GPUStats().cli_devices
  File "/Users/qiasuo/faceswap/lib/gpu_stats/apple_silicon.py", line 40, in __init__
    super().__init__(log=log)
  File "/Users/qiasuo/faceswap/lib/gpu_stats/_base.py", line 95, in __init__
    self._initialize()
  File "/Users/qiasuo/faceswap/lib/gpu_stats/apple_silicon.py", line 52, in _initialize
    self._initialize_metal()
  File "/Users/qiasuo/faceswap/lib/gpu_stats/apple_silicon.py", line 77, in _initialize_metal
    self._test_tensorflow()
  File "/Users/qiasuo/faceswap/lib/gpu_stats/apple_silicon.py", line 90, in _test_tensorflow
    meminfo = tf.config.experimental.get_memory_info('GPU:0')
AttributeError: module 'tensorflow' has no attribute 'config'
(faceswap) qiasuo@kasuos-MacBook-Pro faceswap % pip show tensorflow
Last edited by torzdf on Sat Nov 16, 2024 3:50 am, edited 1 time in total.
User avatar
torzdf
Posts: 2796
Joined: Fri Jul 12, 2019 12:53 am
Answers: 160
Has thanked: 142 times
Been thanked: 650 times

Re: [Guide] macOS Install Guide: Installer Method

Post by torzdf »

Please enter your faceswap environment and post the output of

Code: Select all

conda list

My word is final

User avatar
jiroqodi
Posts: 2
Joined: Fri Jan 10, 2025 7:14 pm
Answers: 0

Re: [Guide] macOS Install Guide: Installer Method

Post by jiroqodi »

Successfully installed Intel Mac w AMD GPU working in CPU mode. I was able to install the tensorflow-macos and tensorflow-metal packages but faceswap still launches in cpu mode. Does anyone have any ideas of what I can do to get faceswap running in GPU mode? Thanks!

Code: Select all

============ System Information ============
backend:             cpu
encoding:            UTF-8
git_branch:          master
git_commits:         41b61f9 Update README.md
gpu_cuda:            No global version found. Check Conda packages for Conda Cuda
gpu_cudnn:           No global version found. Check Conda packages for Conda cuDNN
gpu_devices:         
gpu_devices_active:  
gpu_driver:          
gpu_vram:            
os_machine:          x86_64
os_platform:         macOS-10.16-x86_64-i386-64bit
os_release:          24.1.0
py_command:          /Users/user/faceswap/faceswap.py gui
py_conda_version:    conda 24.11.1
py_implementation:   CPython
py_version:          3.10.16
py_virtual_env:      True
sys_cores:           12
sys_processor:       i386
sys_ram:             Total: 32768MB, Available: 14789MB, Used: 17182MB, Free: 3062MB

=============== Pip Packages ===============
absl-py==2.1.0
astunparse==1.6.3
cachetools==5.5.0
certifi==2024.12.14
charset-normalizer==3.4.1
cloud-tpu-client==0.10
contourpy==1.3.1
cycler==0.12.1
fastcluster==1.2.6
ffmpy==0.5.0
flatbuffers==24.12.23
fonttools==4.55.3
gast==0.4.0
google-api-core==1.34.1
google-api-python-client==1.8.0
google-auth==2.37.0
google-auth-httplib2==0.2.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
googleapis-common-protos==1.66.0
grpcio==1.69.0
h5py==3.12.1
httplib2==0.22.0
idna==3.10
imageio==2.36.1
imageio-ffmpeg==0.5.1
joblib==1.4.2
keras==2.10.0
Keras-Preprocessing==1.1.2
kiwisolver==1.4.8
libclang==18.1.1
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.10.0
mdurl==0.1.2
ml-dtypes==0.3.2
namex==0.0.8
numexpr==2.10.2
numpy==1.26.4
oauth2client==4.1.3
oauthlib==3.2.2
opencv-python==4.10.0.84
opt_einsum==3.4.0
optree==0.13.1
packaging==24.2
pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work
Pillow==9.5.0
protobuf==3.20.3
psutil==6.1.1
ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
pyasn1==0.6.1
pyasn1_modules==0.4.1
Pygments==2.19.1
pyparsing==3.2.1
python-dateutil==2.9.0.post0
requests==2.32.3
requests-oauthlib==2.0.0
rich==13.9.4
rsa==4.9
scikit-learn==1.6.0
scipy==1.15.0
six==1.17.0
tensorboard==2.10.1
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow-cpu==2.10.1
tensorflow-estimator==2.10.0
tensorflow-io-gcs-filesystem==0.37.1
tensorflow-macos==2.10.0
tensorflow-metal==0.6.0
termcolor==2.5.0
threadpoolctl==3.5.0
tqdm @ file:///private/var/folders/c_/qfmhj66j0tn016nkx_th4hxm0000gp/T/abs_5akmb2c3eu/croot/tqdm_1724853941623/work
typing_extensions==4.12.2
uritemplate==3.0.1
urllib3==2.3.0
Werkzeug==3.1.3
wrapt==1.17.0

============== Conda Packages ==============
# packages in environment at /Users/user/miniconda3/envs/faceswap:
#
# Name                    Version                   Build  Channel
absl-py                   2.1.0                    pypi_0    pypi
astunparse                1.6.3                    pypi_0    pypi
blas                      1.0                    openblas  
bzip2                     1.0.8                h6c40b1e_6  
ca-certificates           2024.12.31           hecd8cb5_0  
cachetools                5.5.0                    pypi_0    pypi
certifi                   2024.12.14               pypi_0    pypi
charset-normalizer        3.4.1                    pypi_0    pypi
cloud-tpu-client          0.10                     pypi_0    pypi
contourpy                 1.3.1                    pypi_0    pypi
cycler                    0.12.1                   pypi_0    pypi
fastcluster               1.2.6                    pypi_0    pypi
ffmpy                     0.5.0                    pypi_0    pypi
flatbuffers               24.12.23                 pypi_0    pypi
fonttools                 4.55.3                   pypi_0    pypi
gast                      0.4.0                    pypi_0    pypi
google-api-core           1.34.1                   pypi_0    pypi
google-api-python-client  1.8.0                    pypi_0    pypi
google-auth               2.37.0                   pypi_0    pypi
google-auth-httplib2      0.2.0                    pypi_0    pypi
google-auth-oauthlib      0.4.6                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
googleapis-common-protos  1.66.0                   pypi_0    pypi
grpcio                    1.69.0                   pypi_0    pypi
h5py                      3.12.1                   pypi_0    pypi
httplib2                  0.22.0                   pypi_0    pypi
idna                      3.10                     pypi_0    pypi
imageio                   2.36.1                   pypi_0    pypi
imageio-ffmpeg            0.5.1                    pypi_0    pypi
joblib                    1.4.2                    pypi_0    pypi
keras                     2.10.0                   pypi_0    pypi
keras-preprocessing       1.1.2                    pypi_0    pypi
kiwisolver                1.4.8                    pypi_0    pypi
libclang                  18.1.1                   pypi_0    pypi
libcxx                    14.0.6               h9765a3e_0  
libffi                    3.4.4                hecd8cb5_1  
libgfortran               5.0.0           11_3_0_hecd8cb5_28  
libgfortran5              11.3.0              h9dfd629_28  
libopenblas               0.3.21               h54e7dc3_0  
llvm-openmp               14.0.6               h0dcd299_0  
markdown                  3.7                      pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                3.0.2                    pypi_0    pypi
matplotlib                3.10.0                   pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
ml-dtypes                 0.3.2                    pypi_0    pypi
namex                     0.0.8                    pypi_0    pypi
ncurses                   6.4                  hcec6c5f_0  
numexpr                   2.10.2                   pypi_0    pypi
numpy                     1.26.4                   pypi_0    pypi
oauth2client              4.1.3                    pypi_0    pypi
oauthlib                  3.2.2                    pypi_0    pypi
opencv-python             4.10.0.84                pypi_0    pypi
openssl                   3.0.15               h46256e1_0  
opt-einsum                3.4.0                    pypi_0    pypi
optree                    0.13.1                   pypi_0    pypi
packaging                 24.2                     pypi_0    pypi
pexpect                   4.8.0              pyhd3eb1b0_3  
pillow                    9.5.0                    pypi_0    pypi
pip                       24.2            py310hecd8cb5_0  
protobuf                  3.20.3                   pypi_0    pypi
psutil                    6.1.1                    pypi_0    pypi
ptyprocess                0.7.0              pyhd3eb1b0_2  
pyasn1                    0.6.1                    pypi_0    pypi
pyasn1-modules            0.4.1                    pypi_0    pypi
pygments                  2.19.1                   pypi_0    pypi
pyparsing                 3.2.1                    pypi_0    pypi
python                    3.10.16              hce00570_1  
python-dateutil           2.9.0.post0              pypi_0    pypi
readline                  8.2                  hca72f7f_0  
requests                  2.32.3                   pypi_0    pypi
requests-oauthlib         2.0.0                    pypi_0    pypi
rich                      13.9.4                   pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
scikit-learn              1.6.0                    pypi_0    pypi
scipy                     1.15.0                   pypi_0    pypi
setuptools                72.1.0          py310hecd8cb5_0  
six                       1.17.0                   pypi_0    pypi
sqlite                    3.45.3               h6c40b1e_0  
tensorboard               2.10.1                   pypi_0    pypi
tensorboard-data-server   0.6.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.1                    pypi_0    pypi
tensorflow-cpu            2.10.1                   pypi_0    pypi
tensorflow-estimator      2.10.0                   pypi_0    pypi
tensorflow-io-gcs-filesystem 0.37.1                   pypi_0    pypi
tensorflow-macos          2.10.0                   pypi_0    pypi
tensorflow-metal          0.6.0                    pypi_0    pypi
termcolor                 2.5.0                    pypi_0    pypi
threadpoolctl             3.5.0                    pypi_0    pypi
tk                        8.6.14               h4d00af3_0  
tqdm                      4.66.5          py310h20db666_0  
typing-extensions         4.12.2                   pypi_0    pypi
tzdata                    2024b                h04d1e81_0  
uritemplate               3.0.1                    pypi_0    pypi
urllib3                   2.3.0                    pypi_0    pypi
werkzeug                  3.1.3                    pypi_0    pypi
wheel                     0.44.0          py310hecd8cb5_0  
wrapt                     1.17.0                   pypi_0    pypi
xz                        5.4.6                h6c40b1e_1  
zlib                      1.2.13               h4b97444_1  

================= Configs ==================
--------- convert.ini ---------

[color.color_transfer]
clip:                     True
preserve_paper:           True

[color.match_hist]
threshold:                99.0

[color.manual_balance]
colorspace:               HSV
balance_1:                0.0
balance_2:                0.0
balance_3:                0.0
contrast:                 0.0
brightness:               0.0

[writer.patch]
start_index:              0
index_offset:             0
number_padding:           6
include_filename:         True
face_index_location:      before
origin:                   bottom-left
empty_frames:             blank
json_output:              False
separate_mask:            False
bit_depth:                16
format:                   png
png_compress_level:       3
tiff_compression_method:  lzw

[writer.pillow]
format:                   png
draw_transparent:         False
separate_mask:            False
optimize:                 False
gif_interlace:            True
jpg_quality:              75
png_compress_level:       3
tif_compression:          tiff_deflate

[writer.ffmpeg]
container:                mp4
codec:                    libx264
crf:                      23
preset:                   medium
tune:                     none
profile:                  auto
level:                    auto
skip_mux:                 False

[writer.gif]
fps:                      25
loop:                     0
palettesize:              256
subrectangles:            False

[writer.opencv]
format:                   png
draw_transparent:         False
separate_mask:            False
jpg_quality:              75
png_compress_level:       3

[mask.mask_blend]
type:                     normalized
kernel_size:              3
passes:                   4
threshold:                4
erosion:                  0.0
erosion_top:              0.0
erosion_bottom:           0.0
erosion_left:             0.0
erosion_right:            0.0

[scaling.sharpen]
method:                   none
amount:                   150
radius:                   0.3
threshold:                5.0

--------- gui.ini ---------

[global]
fullscreen:               False
tab:                      extract
options_panel_width:      30
console_panel_height:     20
icon_size:                14
font:                     default
font_size:                9
autosave_last_session:    prompt
timeout:                  120
auto_load_model_stats:    True

--------- .faceswap ---------
backend:                  cpu

--------- extract.ini ---------

[global]
allow_growth:             False
aligner_min_scale:        0.07
aligner_max_scale:        2.0
aligner_distance:         22.5
aligner_roll:             45.0
aligner_features:         True
filter_refeed:            True
save_filtered:            False
realign_refeeds:          True
filter_realign:           True

[detect.mtcnn]
minsize:                  20
scalefactor:              0.709
batch-size:               8
cpu:                      True
threshold_1:              0.6
threshold_2:              0.7
threshold_3:              0.7

[detect.cv2_dnn]
confidence:               50

[detect.s3fd]
confidence:               70
batch-size:               4

[detect.external]
file_name:                import.json
origin:                   top-left

[align.fan]
batch-size:               12

[align.external]
file_name:                import.json
origin:                   top-left
4_point_centering:        head

[mask.unet_dfl]
batch-size:               8

[mask.custom]
batch-size:               8
centering:                face
fill:                     False

[mask.vgg_obstructed]
batch-size:               2

[mask.vgg_clear]
batch-size:               6

[mask.bisenet_fp]
batch-size:               8
cpu:                      False
weights:                  faceswap
include_ears:             False
include_hair:             False
include_glasses:          True

[recognition.vgg_face2]
batch-size:               16
cpu:                      False

--------- train.ini ---------

[global]
centering:                face
coverage:                 87.5
icnr_init:                False
conv_aware_init:          False
optimizer:                adam
learning_rate:            5e-05
epsilon_exponent:         -7
save_optimizer:           exit
lr_finder_iterations:     1000
lr_finder_mode:           set
lr_finder_strength:       default
autoclip:                 False
reflect_padding:          False
allow_growth:             False
mixed_precision:          False
nan_protection:           True
convert_batchsize:        16

[global.loss]
loss_function:            ssim
loss_function_2:          mse
loss_weight_2:            100
loss_function_3:          none
loss_weight_3:            0
loss_function_4:          none
loss_weight_4:            0
mask_loss_function:       mse
eye_multiplier:           3
mouth_multiplier:         2
penalized_mask_loss:      True
mask_type:                extended
mask_dilation:            0
mask_blur_kernel:         3
mask_threshold:           4
learn_mask:               False

[model.phaze_a]
output_size:              128
shared_fc:                none
enable_gblock:            True
split_fc:                 True
split_gblock:             False
split_decoders:           False
enc_architecture:         fs_original
enc_scaling:              7
enc_load_weights:         True
bottleneck_type:          dense
bottleneck_norm:          none
bottleneck_size:          1024
bottleneck_in_encoder:    True
fc_depth:                 1
fc_min_filters:           1024
fc_max_filters:           1024
fc_dimensions:            4
fc_filter_slope:          -0.5
fc_dropout:               0.0
fc_upsampler:             upsample2d
fc_upsamples:             1
fc_upsample_filters:      512
fc_gblock_depth:          3
fc_gblock_min_nodes:      512
fc_gblock_max_nodes:      512
fc_gblock_filter_slope:   -0.5
fc_gblock_dropout:        0.0
dec_upscale_method:       subpixel
dec_upscales_in_fc:       0
dec_norm:                 none
dec_min_filters:          64
dec_max_filters:          512
dec_slope_mode:           full
dec_filter_slope:         -0.45
dec_res_blocks:           1
dec_output_kernel:        5
dec_gaussian:             True
dec_skip_last_residual:   True
freeze_layers:            keras_encoder
load_layers:              encoder
fs_original_depth:        4
fs_original_min_filters:  128
fs_original_max_filters:  1024
fs_original_use_alt:      False
mobilenet_width:          1.0
mobilenet_depth:          1
mobilenet_dropout:        0.001
mobilenet_minimalistic:   False

[model.realface]
input_size:               64
output_size:              128
dense_nodes:              1536
complexity_encoder:       128
complexity_decoder:       512

[model.dfl_sae]
input_size:               128
architecture:             df
autoencoder_dims:         0
encoder_dims:             42
decoder_dims:             21
multiscale_decoder:       False

[model.unbalanced]
input_size:               128
lowmem:                   False
nodes:                    1024
complexity_encoder:       128
complexity_decoder_a:     384
complexity_decoder_b:     512

[model.dlight]
features:                 best
details:                  good
output_size:              256

[model.villain]
lowmem:                   False

[model.dfaker]
output_size:              128

[model.original]
lowmem:                   False

[model.dfl_h128]
lowmem:                   False

[trainer.original]
preview_images:           14
mask_opacity:             30
mask_color:               #ff0000
zoom_amount:              5
rotation_range:           10
shift_range:              5
flip_chance:              50
color_lightness:          30
color_ab:                 8
color_clahe_chance:       50
color_clahe_max_size:     4
Last edited by torzdf on Fri May 23, 2025 11:27 am, edited 2 times in total.
User avatar
tomk
Posts: 1
Joined: Tue Jan 28, 2025 8:42 pm
Answers: 0

Re: [Guide] macOS Install Guide: Installer Method

Post by tomk »

I went through the installation process and I have the gui shortcut on my desktop. When I click it, the program launches for a second then disappears.

I am running macOS Sonoma on a M3 Max MacBook Pro...

Post Reply