创建launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"python": "${fileDirname}/venv/bin/python",
"args": [
"-s",
"~/Downloads/ai/swapfacetest/1.jpg",
"-t",
"~/Downloads/ai/swapfacetest/liudehua.png",
"-o",
"/tmp/o.png",
"--execution-provider",
"cuda"
]
}
]
}
打开文件,按下快捷键F5即可。