vscode launch.json 配置


開宗明義

${workspaceFolder} :表示當前workspace文件夾路徑,

${workspaceRootFolderName}:表示workspace的文件夾名,

${file}:文件自身的絕對路徑,

${relativeFile}:文件在workspace中的路徑

${fileBasenameNoExtension}:當前文件的文件名,不帶后綴

${fileBasename}:當前文件的文件名

${fileDirname}:文件所在的文件夾路徑

${fileExtname}:當前文件的后綴

${lineNumber}:當前文件光標所在的行號

${env:PATH}:系統中的環境變量

 

以mmdetection為例

我們需要的命令是:

python tools/test.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py \
    checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
    --show

 

linux路徑為 /home/yy18dlz/github/mmdetection/

用vscode 打開到上述路徑

配置 launch.json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File",
      "type": "python",
      "request": "launch",
      "program": "${workspaceFolder}/${relativeFile}",
      "console": "integratedTerminal",
      "cwd":"${workspaceFolder}",
      "args": [
        "configs/yolo/yolov3_d53_mstrain-608_273e_coco.py",
        "checkpoints/yolov3_d53_mstrain-608_273e_coco-139f5633.pth",
        "--show",
      ]
    }
  ]
}

打開文件 tools/test.py F5即可完成開頭的命令執行

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM