Skip to content

Latest commit

 

History

History
275 lines (242 loc) · 10.6 KB

File metadata and controls

275 lines (242 loc) · 10.6 KB

System Requirements

Minimal system requirements are:

  • CPU - 4 cores, 3.7GHz
  • RAM - 8Gb
  • Operating System - Windows 7, 10-11/Ubuntu 16-22/ASTRA linux COMMON edition

Specifically for Open MIDAS:

  • It's highly recommended to run examples on GPU

Building and Installation

You can use two parts of library - SDK and OpenMIDAS - separately, so there are different prerequisites and installation steps for them.

SDK

Prerequisites

For Windows:

  • Visual Studio 2017 or newer
    1. Go to the Microsoft site and download the MSVC installer.
      1.1. Also download Build Tools for Visual Studio from this link(This link to install tools for MSVC 22).

    2. Run the installer and select the following toolkit:

      • Under Workloads, select "Desktop C++ Development".
      • Under "Individual Components"->"Compilers, Build Tools, and Runtimes"->"CMake Tools for Windows".
    3. Click install button

  • Python 3.7 or higher
  • Visual C++ Redistributable for Visual Studio 2015 or higher
  • CMake 2.8.12 or higher
    1. Download and install Cmake on your computer
    2. To check if CMake is installed correctly, open a command prompt (Win+R, then write cmd), and enter cmake command.
  • Also you should install gdown pip's package:
    pip.exe install gdown==4.7.1
  • (To build and use Java API) JDK 8
  • (To buiild and use C# API) .NET 7.0 or higher

For Linux:

  • gcc compiler (4.8.5 or higher)
  • Python 3.7 or higher
  • libgtk2.0
  • standard wget and unzip bash utilities
  • gdown pip's package
  • (To build and use Java API) openjdk-8-jdk
  • (To buiild and use C# API) dotnet-sdk-7.0, tesseract-ocr, libdc1394-22, libopenexr24

Below the sample of instructions to install dependencies on Ubuntu

Ubuntu 22.04
sudo apt update
sudo apt install gcc cmake
sudo apt install libgtk2.0-dev
sudo apt install wget unzip
sudo apt install python3 python3-pip libcanberra-gtk-module
sudo apt install lsb-core
pip3 install --upgrade pip setuptools wheel
pip3 install gdown==4.7.1

# Java API dependencies
sudo apt install openjdk-8-jdk
# C# API dependencies
sudo apt install apt-transport-https
sudo apt install dotnet-sdk-7.0
sudo apt install tesseract-ocr
sudo apt install libdc1394-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev
sudo apt install libopenexr-dev
Ubuntu 20.04
sudo apt update
sudo apt install gcc cmake
sudo apt install libgtk2.0-dev
sudo apt install wget unzip
sudo apt install python3 python3-pip libcanberra-gtk-module
sudo apt install lsb-core
pip3 install --upgrade pip setuptools wheel
pip3 install gdown==4.7.1

# Java API dependencies
sudo apt install openjdk-8-jdk
# C# API dependencies
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt install apt-transport-https
sudo apt update
sudo apt install dotnet-sdk-7.0
sudo apt install tesseract-ocr
sudo apt install libdc1394-22 libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev
sudo apt install openexr
rm -f packages-microsoft-prod.deb
Ubuntu 18.04
sudo apt update
sudo apt install gcc cmake
sudo apt install libgtk2.0-dev
sudo apt install wget unzip
sudo apt install python3 python3-pip libcanberra-gtk-module
sudo apt install lsb-core
pip3 install --upgrade pip setuptools wheel
pip3 install gdown==4.7.1

# Java API dependencies
sudo apt install openjdk-8-jdk
# C# API dependencies
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt install apt-transport-https
sudo apt update
sudo apt install dotnet-sdk-7.0 tesseract-ocr
sudo apt install libdc1394-22 libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev
sudo apt install openexr
rm -f packages-microsoft-prod.deb
Ubuntu 16.04
sudo apt update
sudo apt install gcc cmake
sudo apt install libgtk2.0-dev
sudo apt install wget unzip
sudo apt install python3 python3-pip libcanberra-gtk-module
sudo apt install lsb-core

# There might be problems with system python in ubuntu 16.
# Thus we recommend to install Python 3.8. Follow instructions to make python 3.8 your system python3 interpreter.
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev -y
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -xf Python-3.8.0.tgz
cd Python-3.8.0 && ./configure --enable-optimizations && make && sudo make install && cd ..

pip3.8 install --upgrade pip setuptools wheel --user
pip3.8 install urllib3==1.26.6 --user

# Java API dependencies
sudo apt install openjdk-8-jdk
# C# API dependencies
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt install apt-transport-https
sudo apt update
sudo apt install dotnet-sdk-6.0
sudo apt install tesseract-ocr
sudo apt install libdc1394-22 libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev
sudo apt install openexr
rm -f packages-microsoft-prod.deb

Install SDK and run samples screencasts

Windows
Linux

Build C++

Clone this repo

git clone https://github.com/3DiVi/open-source-face-sdk

and follow instructions for your platform.
For Windows:

  • We HIGHLY recommend to use Developer PowerShell for VS on Windows
  • Set PowerShell policy to Unrestricted. PowerShell policy should be set to Unrestricted to download SDK dependencies and configure SDK build.
    1. Open PowerShell as Administrator
    2. Enter the command Set-ExecutionPolicy Unrestricted
    3. Enter Y
  • Build SDK. To configure SDK project, use the make_project.ps1 script. This script will automatically find and install all the necessary dependencies and build the project. To run, use the following command in Windows Powershell:
    cd open-source-face-sdk\sdk
    .\scripts\windows\make_project.ps1
    Then, open the build\open_sourse_sdk.sln solution in Visual Studio. Select Release configuration to build SDK and build INSTALL project.

For Linux:

  • Use the build_sdk.sh script. This script will automatically find and install all the necessary dependencies and build the project. To run, use the following command:

    cd open-source-face-sdk/sdk
    ./scripts/linux_x86_64/build_sdk.sh    

Build Python API

When you successfully built C++ API on previous step, you can install python_api (located in build/make-install after library building) via the comand

pip3 install <path_to_python_api_folder>

Alternatively, you can use prebuilt pip packages to install Python API.
For Windows

pip3 install http://download.3divi.com/facesdk/archives/artifacts/wl/windows/face_sdk-1.0.0-py3-none-any.whl

For Linux:

pip3 install  http://download.3divi.com/facesdk/archives/artifacts/wl/linux/face_sdk-1.0.0-py3-none-any.whl

Build Java API Sample

If you want to use Java API, you should call build script from Build C++ step with path to your JDK installation. For example, on Linux there should be command

cd open-source-face-sdk/sdk
./scripts/linux_x86_64/build_sdk.sh  /usr/lib/jvm/java-8-openjdk-amd64   

After that, go to sdk/samples/java and make there bin directory. Then, you can build and run Java API sample with the next commands

javac -sourcepath ../../src/java_api/src/ -d bin com/face_detector_demo/face_detector_demo.java 
LD_LIBRARY_PATH=../../build/make-install/lib java -classpath ./bin com.face_detector_demo.face_detector_demo  ../../test_images/face.jpg ../../build/make-install

Example of these steps for Windows:

cd open-source-face-sdk\sdk
.\scripts\windows\make_project.ps1 "C:\Program Files\Java\jdk-1.8"   

After that, go to sdk/samples/java and make there bin directory. Then, you can build and run Java API sample with the next commands

javac -sourcepath ../../src/java_api/src/ -d bin com/face_detector_demo/face_detector_demo.java 

Call Java sample from sdk/build/make-install/bin

java -classpath ../../../samples/java/bin com.face_detector_demo.face_detector_demo ../../../test_images/face.jpg ../

Build C#

If you successfully built C++ API on previous steps, you can use builded library to work with C# API.
For Windows

  • In sdk folder run following cmd command to build csharp_face_demo for Windows
    .\scripts\windows\create_csharp_demo.bat
  • This script builds face demo by default. To build body or estimator demo, just call the script with corresponding argument.
    .\scripts\windows\create_csharp_demo.bat body
    .\scripts\windows\create_csharp_demo.bat estimator

For Linux

  • In sdk folder run following cmd command to build csharp_face_demo for Linux
    ./scripts/linux_x86_64/create_csharp_demo.sh
  • This script builds face demo by default. To build body or estimator demo, just call the script with corresponding argument.
    ./scripts/linux_x86_64/create_csharp_demo.sh body
    ./scripts/linux_x86_64/create_csharp_demo.sh estimator

OpenMIDAS

Prerequisites

Python 3.10.8 or higher

Installation

Clone this repo and run following command from open_midas folder to install required dependencies

pip3 install -r requirements.txt

Also, you can check screencast describing OpenMIDAS installation and sample notebook execution.