日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

macos上的硬盘检测工具_如何在MacOS上使用双镜头面部检测器(DSFD)实现90%以上的精度

發布時間:2023/12/15 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 macos上的硬盘检测工具_如何在MacOS上使用双镜头面部检测器(DSFD)实现90%以上的精度 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

macos上的硬盤檢測工具

新程序員指南: (New Programmer’s Guide:)

介紹: (Introduction:)

This article is for those of us still early in our programming path — keep going

本文適用于尚處于編程道路初期的我們這些人-繼續前進

If you’re still new to programming, I encourage you to complete this tutorial because DSFD is worth it and going through this process will stretch you.

如果您還不熟悉編程,建議您完成本教程,因為DSFD是值得的,并且逐步完成此過程將使您受益匪淺。

It’s intentionally thorough, so you should have everything you need.

這是有意為之的,因此您應該擁有所需的一切。

But if something isn’t covered, leave a comment and we’ll figure it out.

但是,如果未涵蓋某些內容,請發表評論,我們會解決。

This article is written for MacOS, but it’s also available for Windows.

本文是針對MacOS編寫的,但也適用于Windows 。

背景: (Background:)

In this paper, Tencent introduces its open-sourced Dual Shot Face Detector (DSFD) algorithm. DSFD is a new face detection network that addresses three key areas of facial detection. This includes better feature learning, progressive loss design, and anchor assign based data augmentation.

在本文中 ,騰訊介紹了其開源的雙鏡頭面部檢測器 (DSFD)算法。 DSFD是一個新的面部檢測網絡 ,解決了面部檢測的三個關鍵領域。 這包括更好的功能學習,漸進式損失設計以及基于錨分配的數據擴充。

In 2018, the DSFD algorithm ranked first across the board in the WIDER FACE Face Detection Benchmark.

在2018年,DSFD算法在WIDER FACE人臉檢測基準測試中全面排名第一。

DSFDDSFD提供

The benchmark evaluation tested the detection systems for mean average precision (mAP) on set portions of the dataset split into three difficulty levels.

基準評估測試了檢測系統在分為三個難度級別的數據集的設置部分的平均平均精度 (mAP)。

Validation set scores:

驗證集分數:

  • 96.6% (mAP) in the easy difficulty level

    輕松難度水平為96.6%(mAP)
  • 95.7% (mAP) in the medium difficulty level

    中難度水平為95.7%(mAP)
  • 90.4% (mAP) in the hard difficulty level

    困難難度等級為90.4%(mAP)

Test set scores:

測試集分數:

  • 96.0% (mAP) in the easy difficulty level

    輕松難度水平為96.0%(mAP)
  • 95.3% (mAP) in the medium difficulty level

    中難度水平為95.3%(mAP)
  • 90.0% (mAP) in the hard difficulty level

    困難難度等級為90.0%(mAP)

In this paper, the Multitask Cascade CNN (MTCNN) was evaluated using the same WIDER FACE Face Detection Benchmark.

本文使用相同的WIDER FACE人臉檢測基準對多任務級聯CNN(MTCNN)進行了評估。

Validation set scores:

驗證集分數:

  • 84.8% (mAP) in the easy difficulty level

    輕松難度水平為84.8%(mAP)
  • 82.5% (mAP) in the medium difficulty level

    中難度水平為82.5%(mAP)
  • 60.7% (mAP) in the hard difficulty level

    困難難度水平為60.7%(mAP)

Test set scores:

測試集分數:

  • 85.1% (mAP) in the easy difficulty level

    輕松難度水平為85.1%(mAP)
  • 82.0% (mAP) in the medium difficulty level

    中難度水平為82.0%(mAP)
  • 60.7% (mAP) in the hard difficulty level

    困難難度水平為60.7%(mAP)

克隆存儲庫: (Clone the Repository:)

First, we’ll open Terminal:

首先,我們打開終端:

  • Press “Command ?”

    按“ Command?”
  • Enter “Terminal”

    輸入“終端”
  • Press “Return”

    按“返回”
  • Next, we’ll use the mkdir command to create the project directory:

    接下來,我們將使用mkdir命令創建項目目錄:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • mkdir $HOME/Desktop/Projects/

    Next, we’ll use the cd command to navigate to the project directory:

    接下來,我們將使用cd命令導航到項目目錄:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • cd $HOME/Desktop/Projects/

    Next, we’ll use the git clone command to download the repository:

    接下來,我們將使用git clone命令下載存儲庫:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • git clone https://github.com/Tencent/FaceDetection-DSFD

    Next, we’ll use the cd command to navigate to the repository directory:

    接下來,我們將使用cd命令導航到存儲庫目錄:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • cd FaceDetection-DSFD

    設置Python要求: (Set Up the Python Requirement:)

    First, we’ll download Python 3.6:

    首先,我們將下載Python 3.6:

  • Visit the download page on the official website

    訪問官方網站上的下載頁面

  • Scroll to the “Files” section

    滾動到“文件”部分
  • Download the “MacOS 64-Bit/32-Bit Installer”

    下載“ MacOS 64位/ 32位安裝程序”
  • Next, we’ll install the required Python version:

    接下來,我們將安裝所需的Python版本:

  • Open the downloaded file

    打開下載的文件
  • Perform the default installation

    執行默認安裝
  • 創建虛擬環境: (Create the Virtual Environment:)

    The virtualenv command creates a virtual environment with the specified Python version. The command format is command name, Python parameter, Python executable file, virtual environment name.

    virtualenv命令使用指定的Python版本創建虛擬環境。 命令格式為命令名稱,Python參數,Python可執行文件,虛擬環境名稱。

    First, we’ll install virtualenv:

    首先,我們將安裝virtualenv:

  • Reopen Terminal

    重新打開終端
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • python -m pip install virtualenv

    Next, we’ll create the virtual environment with Python 3.6:

    接下來,我們將使用Python 3.6創建虛擬環境:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • virtualenv -p python36 venv36

    Next, we’re going to activate the virtual environment:

    接下來,我們將激活虛擬環境:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • The virtual environment name will appear on the command-line while active.

    虛擬環境名稱在活動時將顯示在命令行上。

    All pip installations will now be saved in the local virtual environment.

    現在,所有pip安裝都將保存在本地虛擬環境中。

    source venv36/bin/activate

    設置火炬要求: (Set Up the Torch Requirement:)

    First, we’ll download Torch 0.3.1:

    首先,我們將下載Torch 0.3.1:

  • Visit the download page for your Cuda version: [Cpu Only]

    訪問您的Cuda版本的下載頁面:[ 僅Cpu ]

  • Scroll to the wheel file from below these instructions

    從這些說明下面滾動到wheel文件
  • Click the link to download the file

    點擊鏈接下載文件
  • The Torch version required isn’t available in pip or anaconda.

    所需的Torch版本在pip或anaconda中不可用。

    torch-0.3.1-cp36-cp36m-macosx_10_7_x86_64.whl

    Next, we’ll use the mouse to move the wheel file:

    接下來,我們將使用鼠標移動wheel文件:

  • Open Finder

    打開查找器
  • Click “Downloads” in the left panel

    點擊左側面板中的“下載”
  • Scroll to the file from below these instructions

    從這些說明下面滾動到文件
  • Right-click the provided file

    右鍵單擊提供的文件
  • Click “Copy”

    點擊“復制”
  • Navigate to the repository directory

    導航到存儲庫目錄
  • Right-click inside the directory

    在目錄內右鍵單擊
  • Press and Hold “Option?”

    按住“Option?”
  • Click “Move Item Here”

    點擊“在此處移動項目”
  • Release “Option ?”

    釋放“選項?”
  • torch-0.3.1-cp36-cp36m-macosx_10_7_x86_64.whl

    Lastly, we’ll install Torch:

    最后,我們將安裝Torch:

  • Reopen Terminal

    重新打開終端
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • pip install torch-0.3.1-cp36-cp36m-macosx_10_7_x86_64.whl

    設置TorchVision要求: (Set Up the TorchVision Requirement:)

    First, we’ll download Torchvision 0.2.1:

    首先,我們將下載Torchvision 0.2.1:

  • Visit the archive page for your system type: [All]

    訪問存檔頁面以查找您的系統類型:[ 全部 ]

  • Scroll to the wheel file from below these instructions

    從這些說明下面滾動到wheel文件
  • Click the link to download the file

    點擊鏈接下載文件
  • The TorchVision version required isn’t available in pip or anaconda.

    所需的TorchVision版本在pip或anaconda中不可用。

    torchvision-0.2.1-py2.py3-none-any.whl

    Next, we’ll use the mouse to move the wheel file:

    接下來,我們將使用鼠標移動wheel文件:

  • Reopen Finder

    重新開啟搜尋器
  • Click “Downloads” in the left panel

    點擊左側面板中的“下載”
  • Scroll to the file from below these instructions

    從這些說明下面滾動到文件
  • Right-click the provided file

    右鍵單擊提供的文件
  • Click “Copy”

    點擊“復制”
  • Navigate to the repository directory

    導航到存儲庫目錄
  • Right-click inside the directory

    在目錄內右鍵單擊
  • Press and Hold “Option?”

    按住“Option?”
  • Click “Move Item Here”

    點擊“在此處移動項目”
  • Release “Option ?”

    釋放“選項?”
  • torchvision-0.2.1-py2.py3-none-any.whl

    Lastly, we’ll install Torchvision:

    最后,我們將安裝Torchvision:

  • Reopen Terminal

    重新打開終端
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • pip install torchvision-0.2.1-py2.py3-none-any.whl

    設置其他要求: (Set Up the Other Requirements:)

    First, we’ll install the other requirements:

    首先,我們將安裝其他要求:

  • Reopen Terminal

    重新打開終端
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • pip install matplotlib opencv-python scipy

    Next, we’ll use the mkdir command to create a subdirectory:

    接下來,我們將使用mkdir命令創建一個子目錄:

  • Reopen Terminal

    重新打開終端
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • This subdirectory is used to store the output images.

    該子目錄用于存儲輸出圖像。

    mkdir eval_tools

    設置模型: (Set Up the Model:)

    First, we’ll download the model file:

    首先,我們將下載模型文件:

  • Visit the DSFD Google Drive

    訪問DSFD Google云端硬盤

  • Click the “Download” button

    點擊“下載”按鈕
  • Click the “Download anyway” button

    點擊“仍然下載”按鈕
  • Next, we’ll use the mkdir command to create a subdirectory:

    接下來,我們將使用mkdir命令創建一個子目錄:

  • Reopen Terminal

    重新打開終端
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Terminal

    將命令粘貼到終端
  • Press “Return”

    按“返回”
  • mkdir weights

    Next, we’ll use the mouse to move the model file:

    接下來,我們將使用鼠標移動模型文件:

  • Reopen Finder

    重新開啟搜尋器
  • Click “Downloads” in the left panel

    點擊左側面板中的“下載”
  • Scroll to the file from below these instructions

    從這些說明下面滾動到文件
  • Right-click the provided file

    右鍵單擊提供的文件
  • Click “Copy”

    點擊“復制”
  • Navigate to the repository directory

    導航到存儲庫目錄
  • Open the “weights” subdirectory

    打開“ weights”子目錄
  • Right-click inside the directory

    在目錄內右鍵單擊
  • Press and Hold “Option?”

    按住“Option?”
  • Click “Move Item Here”

    點擊“在此處移動項目”
  • Release “Option ?”

    釋放“選項?”
  • WIDERFace_DSFD_RES152.pth

    設置注釋: (Set Up the Annotations:)

    First, we’ll download the annotations file:

    首先,我們將下載注釋文件:

  • Visit the WIDER FACE official site

    訪問WIDER FACE 官方網站

  • Scroll to the “Download” section

    滾動到“下載”部分
  • Click “Face Annotations”

    點擊“面部注釋”
  • Next, we’ll use the mouse to move the annotations file:

    接下來,我們將使用鼠標移動注釋文件:

  • Reopen Finder

    重新開啟搜尋器
  • Click “Downloads” in the left panel

    點擊左側面板中的“下載”
  • Scroll to the file from below these instructions

    從這些說明下面滾動到文件
  • Right-click the provided file

    右鍵單擊提供的文件
  • Click “Copy”

    點擊“復制”
  • Navigate to the repository directory in Finder

    導航到Finder中的存儲庫目錄
  • Open the “data” subdirectory

    打開“數據”子目錄
  • Right-click inside the directory

    在目錄內右鍵單擊
  • Press and Hold “Option?”

    按住“Option?”
  • Click “Move Item Here”

    點擊“在此處移動項目”
  • Release “Option ?”

    釋放“選項?”
  • wider_face_split.zip

    Lastly, we’ll unzip the annotations file:

    最后,我們將解壓注釋文件:

  • Click the “Back” button in Finder

    點擊Finder中的“返回”按鈕
  • Right-click the file from below these instructions

    從這些說明下面右鍵單擊文件
  • Click “Open”

    點擊“打開”
  • wider_face_split.zip

    修正錯誤: (Fix the Errors:)

    The following solutions were pieced together by:

    以下解決方案組合在一起:

    • Reading through the “open” and “closed” issues section of the repository

      通讀存儲庫的“ 打開 ”和“ 關閉 ”問題部分

    • Translating different languages with Google Translate extension

      使用Google翻譯擴展程序翻譯不同的語言

    • Googling the error message and reading through the first five results

      搜尋錯誤訊息并讀取前五個結果

    The line numbers are not exact and meant to be used as approximations.

    行號不精確,只能用作近似值。

    錯誤1: (Error #1:)

    UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead

    UserWarning:volatile已刪除,現在無效。 使用`with torch.no_grad():`代替

    In this section, we’ll add edit to the following files:

    在本節中,我們將對以下文件添加編輯:

    • demo.py

      演示
    • face_ssd.py

      face_ssd.py
    • widerface_val.py

      wideface_val.py

    錯誤2: (Error #2:)

    RuntimeError: CUDA out of memory. Tried to allocate 44.25 MiB (GPU 0; 11.00 GiB total capacity; 9.56 GiB already allocated; 10.25 MiB free; 49.26 MiB cached)

    RuntimeError:CUDA內存不足。 嘗試分配44.25 MiB(GPU 0; 11.00 GiB總容量;已分配9.56 GiB; 10.25 MiB空閑; 49.26 MiB已緩存)

    In this section, we’ll add edit to the following file:

    在本節中,我們將編輯添加到以下文件:

    • demo.py

      演示

    錯誤3: (Error #3:)

    FileNotFoundError: [Errno 2] No such file or directory: ‘/data2/lijian/widerface/data/wider_face_split\\wider_face_val.mat’

    FileNotFoundError:[錯誤2]沒有這樣的文件或目錄:'/data2/lijian/widerface/data/wider_face_split\\wider_face_val.mat'

    In this section, we’ll edit the following file :

    在本節中,我們將編輯以下文件:

    • data\widerface.py

      數據\ widerface.py

    錯誤4: (Error #4:)

    ImportError: cannot import name ‘pa_sfd_match’

    ImportError:無法導入名稱“ pa_sfd_match”

    In this section, we’ll edit the following file:

    在本節中,我們將編輯以下文件:

    • layers\modules\multibox_loss.py

      圖層\模塊\ multibox_loss.py

    錯誤5: (Error #5:)

    TypeError: mul(): argument ‘other’ (position 1) must be Tensor, not numpy.ndarray

    TypeError:mul():參數'other'(位置1)必須為Tensor,而不是numpy.ndarray

    In this section, we’ll edit to the following file:

    在本節中,我們將編輯以下文件:

    • demo.py

      演示

    錯誤#6: (Error #6:)

    RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=’cpu’ to map your storages to the CPU.

    RuntimeError:嘗試在CUDA設備上反序列化對象,但是torch.cuda.is_available()為False。 如果您在僅CPU的計算機上運行,??請使用帶有map_location ='cpu'的torch.load將存儲映射到CPU。

    This step only applies to computers that don’t have a GPU — CPU only.

    此步驟僅適用于沒有GPU的計算機-僅適用于CPU。

    In this section, we’ll change edit the following file:

    在本節中,我們將更改編輯以下文件:

    • venv36/lib/python3.6/site-packages/torch/serialization.py

      venv36 / lib / python3.6 / site-packages / torch / serialization.py

    錯誤7: (Error #7:)

    AssertionError: Torch not compiled with CUDA enabled.

    AssertionError:火炬未在啟用CUDA的情況下編譯。

    This step only applies to computers that don’t have a GPU — CPU only.

    此步驟僅適用于沒有GPU的計算機-僅適用于CPU。

    In this section, we’ll edit in the following files:

    在本節中,我們將編輯以下文件:

    • demo.py

      演示
    • widerface_val.py

      wideface_val.py

    錯誤#8: (Error #8:)

    UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. “See the documentation of nn.Upsample for details.”.format(mode))

    UserWarning:自0.4.0開始,當mode = bilinear更改為align_corners = False時,默認的上采樣行為。 如果需要舊的行為,請指定align_corners = True。 有關詳細信息,請參見nn.Upsample的文檔。 “有關詳細信息,請參見nn.Upsample的文檔。”。format(mode))

    Lastly, we’ll edit the following file:

    最后,我們將編輯以下文件:

    • demo.py

      演示

    獲取命令行參數: (Get the Command-Line Parameters:)

    Sometimes, the command-line parameters are not included in a repository’s description. In that case, the parameters can usually be found underneath the import section in the code file.

    有時,命令行參數未包含在存儲庫的描述中。 在這種情況下,通常可以在代碼文件的import部分下面找到參數。

    Check the Add Argument method:

    檢查添加參數方法:

    • The first argument is the parameter.

      第一個參數是參數。
    • The last argument describes what it does

      最后一個參數描述了它的作用

    For example:

    例如:

    • “ — image_root” refers to the “location of test image directory”

      “ — image_root”是指“測試圖像目錄的位置”
    • “ — visual_threshold” refers to the “final confidence threshold”

      “ — visual_threshold”是指“最終置信度閾值”
    demo.py:
    parser = argparse.ArgumentParser(description='DSFD:Dual Shot Face Detector')
    parser.add_argument('--trained_model', default='weights/WIDERFace_DSFD_RES152.pth',
    type=str, help='Trained state_dict file path to open')
    parser.add_argument('--save_folder', default='eval_tools/', type=str,
    help='Dir to save results')
    parser.add_argument('--visual_threshold', default=0.1, type=float,
    help='Final confidence threshold')
    parser.add_argument('--cuda', default=False, type=bool,
    help='Use cuda to train model')
    parser.add_argument('--img_root', default='./data/worlds-largest-selfie.jpg', help='Location of test images directory')
    parser.add_argument('--widerface_root', default=WIDERFace_ROOT, help='Location of WIDERFACE root directory')
    args = parser.parse_args()

    測試演示 (Test the Demo)

    In this section, we’ll test the demo.py file:

    在本節中,我們將測試demo.py文件:

  • Reopen Command Prompt

    重新打開命令提示符
  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Command Prompt

    將命令粘貼到命令提示符中
  • Press “Enter”

    按“ Enter”
  • python demo.py --img_root ./data/worlds-largest-selfie.jpg --visual_threshold 0.7

    停用虛擬環境: (Deactivate the Virtual Environment:)

    In this section, we’ll deactivate the virtual environment:

    在本節中,我們將停用虛擬環境:

  • Copy the command from below these instructions

    從這些說明下面復制命令
  • Paste the command into Command Prompt

    將命令粘貼到命令提示符中
  • Press “Enter”

    按“ Enter”
  • The virtual environment name will then disappear from the command-line.

    然后,虛擬環境名稱將從命令行中消失。

    All pip installations will now be saved in the regular Python environment.

    現在,所有pip安裝都將保存在常規Python環境中。

    deactivate

    致謝: (Acknowledgments:)

    @oyerst solved this issue

    @ oyerst解決了這個問題

    @hypadr1v3 solved this issue

    @ hypadr1v3解決了這個問題

    @lijiannuist solved this issue and that issue

    @ lijiannuist解決了這個問題和那個問題

    @vlad3996 solved this issue

    @ vlad3996解決了這個問題

    @yihongXU solved this issue

    @yihongXU解決了這個問題

    翻譯自: https://medium.com/macoclock/how-to-implement-the-dual-shot-face-detector-dsfd-demo-on-macos-706dde217ead

    macos上的硬盤檢測工具

    總結

    以上是生活随笔為你收集整理的macos上的硬盘检测工具_如何在MacOS上使用双镜头面部检测器(DSFD)实现90%以上的精度的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。