当前位置: 首页 > 工具软件 > OpenBR > 使用案例 >

OpenBR编译

柏夕
2023-12-01

我是在OS X上编译OpenBR的,另外在云主机上编译Qt这种东西简直太坑了!

OpenBR有一个人脸比对的功能,效果还可以,主要是在标数据时候用。

编译过程基本遵循如下:

  1. Download and install the latest "XCode" and "Command Line Tools" from the Apple Developer Downloads page.

  2. Download CMake 3.0.2

        $ cd ~/Downloads
        $ tar -xf cmake-2.8.11.2.tar.gz
        $ cd cmake-2.8.11.2
        $ ./configure
        $ make -j4
        $ sudo make install
        $ cd ..
        $ rm -rf cmake-2.8.11.2*
    
  3. Download OpenCV 2.4.11

    $ cd ~/Downloads
    $ unzip opencv-2.4.11.zip
    $ cd opencv-2.4.11
    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release ..
    $ make -j4
    $ sudo make install
    $ cd ../..
    $ rm -rf opencv-2.4.11*
    
  4. Download and install Qt 5.4.1

  5. Create a GitHub account, follow their instructions for setting up Git.

    $ git clone https://github.com/biometrics/openbr.git 

    $ cd openbr 

    $ git checkout 0.5   官方给出的是错的,此处应为:git checkout master

    $ git submodule init 

    $ git submodule update

  6. Build OpenBR!

    mkdir build # from the OpenBR root directory 

    cd build 

    $ cmake -DCMAKE_PREFIX_PATH=~/Qt/5.4.1/clang_64 -DCMAKE_BUILD_TYPE=Release ..  应为:cmake -DCMAKE_PREFIX_PATH=~/Qt5.4.1/5.4/clang_64 -DCMAKE_BUILD_TYPE=Release  -DBR_EMBEDDED=True -DBR_WITH_STASM4=False ..

    make -j4 

    sudo make install

  7. Hack OpenBR!

    1. Open Qt Creator IDE

      $ open ~/Qt/Qt\ Creator.app   应为:  open ~/Qt5.4.1/Qt\ Creator.app/

    2. From the Qt Creator "File" menu select "Open File or Project...".

    3. Select "openbr/CMakeLists.txt" then "Open".
    4. Browse to your pre-existing build directory "openbr/build" then select "Continue".
    5. Select "Run CMake" then "Done".
    6. You're all set! You can find more information on Qt Creator here if you need it.
  8. (Optional) Test OpenBR!

    $ cd openbr/scripts
    $ ./downloadDatasets.sh
    $ cd ../build
    $ make test
    
  9. (Optional) Package OpenBR!

    $ cd openbr/build
    $ sudo cpack -G TGZ
    
  10. (Optional) Build OpenBR documentation!

Need to remake this step with the new docs!

 

我标红字的地方注意即可。

 类似资料: