2021-10-31 19:57:10 索煒達電子 869
項目編號:E2033
文件大?。?60K
源碼說明:帶中文注釋
開發(fā)環(huán)境:C編譯器
簡要概述
可以在本地或云上(在AWS F1實例上)在FPGA上測試人臉檢測。該項目與Inacel Coral集成,這意味著示例應(yīng)用程序可以在FPGA集群上運行,而無需對提供的源代碼進行任何更改。
基于單個FPGA的人臉檢測
基于FPGA集群的人臉檢測
Prerequisites
Docker
InAccel CLI
InAccel Coral-API
OpenCV libraries
You can find instructions on installing docker at https://docs.docker.com/engine/install/. Alternatively, you can install docker using the following command and further on manually configure it to start/enable the service, add your user to the docker group etc.:
curl -sS https://get.docker.com | sh
For a full documentation of the InAccel stack you can refer to https://docs.inaccel.com. To install InAccel CLI you can use the following command
curl -sS https://setup.inaccel.com/repo | sh -s install
Depending on your system you can either use apt or yum to install InAccel Coral API.
sudo apt/yum install coral-api
To install any necessary OpenCV library on Ubuntu you can simply execute the following command:
sudo apt install libopencv-*
For Centos and RedHat you can use the following flow for installing and configuring the OpenCV environment:
git clone https://github.com/opencv/opencv.git && cd opencv && git checkout 3.4.2 && cd ..
mkdir opencv/build && cd opencv/build && cmake .. && make -j && make install && cd ../..
ln -s /usr/local/share/OpenCV/java/libopencv_java342.so /usr/lib/libopencv_java342.so
rm -rf opencv
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
Install a license:
After you have installed all the required packages, you need to configure InAccel. Create a free license using the following link https://inaccel.com/license/. In a few moments you will receive your license at the mail address you provided.
inaccel config license <paste-your-license-here>
Start InAccel:
inaccel start
Install any necessary bitstreams
To run the application on FPGAs you need the right bitstreams. To make face-detection available for Xilinx Alveo U200 install the following bitstream:
https://store.inaccel.com/artifactory/bitstreams/xilinx/u200/xdma_201830.2/edu/cornell/ece/zhang/rosetta/1.4/8face-detect
To use face detection on AWS please install the following bitsteam:
https://store.inaccel.com/artifactory/bitstreams/xilinx/aws-vu9p-f1/dynamic_5.0/edu/cornell/ece/zhang/rosetta/1.1/4face-detect
Run the Face Detection Application
Apart from the FPGA accelerated version we also provide a CPU (reference) version of Viola Jones algorithm. The version is specified using the TARGET variable. TARGET can either be 'hw' or 'sw'.
For example, to generate the binary for the FPGA accelerated version you can issue the following command:
TARGET=hw make
The binary takes any input videos or cameras as arguments. E.g:
./face_detect_hw /path/to/video1 /path/to/video2 ...
目錄│文件列表:
└ face-detect
│ Makefile
│ NOTICE
├ hw
│ │ face_detect_save.cpp
│ │ face_detect_view.cpp
│ │ rectangles.cpp
│ │ rectangles.h
│ │ safe_queue.h
│ │ utils.cpp
│ └ utils.h
├ img
│ │ face-detect-cluster.jpg
│ └ face-detect.png
└ sw
│ class.txt
│ face_detect_save.cpp
│ face_detect_view.cpp
│ haar.cpp
│ haar.h
│ image.cpp
│ image.h
│ info.txt
│ rectangles.cpp
│ safe_queue.h
│ stdio-wrapper.cpp
└ stdio-wrapper.h