how can use this face swap using RestAPI

#5
by PrashantD - opened

I wanted to use this Face Swap using API for one of my web project

Hello PrashantD,

There is currently no API and I have no plans to set up an API as of now.
You can check the github for how to use the models locally.

Oke, thanks for quick response, I tried it on my system its working but it's using CPU, can I force it to use GPU

Hi,

Did you install TensorFlow properly?

Try this to see if TensorFlow finds any GPUs:

import tensorflow as tf
print("Number of GPUs available: ", len(tf.config.list_physical_devices('GPU')))

Hi Felix Rosberg - Please guide me to download FaceDancer_config_c_HQ.h5 Model.

Hi Felix Rosberg - Please guide me to download FaceDancer_config_c_HQ.h5 Model.

You will get it here
https://huggingface.co/felixrosberg/FaceDancer/tree/main

Hi,

Did you install TensorFlow properly?

Try this to see if TensorFlow finds any GPUs:

import tensorflow as tf
print("Number of GPUs available: ", len(tf.config.list_physical_devices('GPU')))

Yes the tensorFlow detects the GPU
I am testing on my Laptop so it shows 2 GPU

Please can you help me with this error.

2023-10-11 17:40:24.480874: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-10-11 17:40:25.516729: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
/usr/local/lib/python3.10/dist-packages/tensorflow_addons/utils/ensure_tf_install.py:53: UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.7.0 and strictly below 2.10.0 (nightly versions are not supported). 
 The versions of TensorFlow you are currently using is 2.13.0 and is not supported. 
Some things might work, some things might not.
If you were to encounter a bug, do not file an issue.
If you want to make sure you're using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons's version. 
You can find the compatibility matrix in TensorFlow Addon's readme:
https://github.com/tensorflow/addons
  warnings.warn(
Traceback (most recent call last):
  File "/content/face-swap/app.py", line 17, in <module>
    token = os.environ['model_fetch']
  File "/usr/lib/python3.10/os.py", line 680, in __getitem__
    raise KeyError(key) from None
KeyError: 'model_fetch'

Sign up or log in to comment