from gradio_client import Client | |
client = Client("https://felixrosberg-face-swap.hf.space/") | |
result = client.predict( | |
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png", # str (filepath or URL to image) in 'Target' Image component | |
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png", # str (filepath or URL to image) in 'Source' Image component | |
0, # int | float (numeric value between 0 and 100) in 'Anonymization ratio (%)' Slider component | |
0, # int | float (numeric value between 0 and 100) in 'Adversarial defense ratio (%)' Slider component | |
"Compare", # List[str] in 'Mode' Checkboxgroup component | |
fn_index=1 | |
) | |
print(result) |