Giter Site home page Giter Site logo

nativelibwithqt's Introduction

1.Introduction

This document provides a procedure to train an CDCN model to detect liveness from images.

2. Preparing the enviroment

2.1.Get and install CDCN

Create a main folder for project:

mkdir CDCN-Model 

Download:

cd CDCN-Model 
git clone https://github.com/ZitongYu/CDCN.git

2.2 Create a folder for Python virtual environments

2.2.1.Download python3.8 -venv to create environment:

You must be in ../CDCN-Model folder.

sudo apt install python3.8-venv

2.2.2.Create python environment

python3 -m venv cdcn-env

2.2.3.Activate python environment

source cdcn-env/bin/activate

3.Install essential packages that will be used by CDCN building

Install required packages:

pip3 --no-cache-dir install torchvision
pip install matplotlib
pip3 --no-cache-dir install pandas
pip install scikit-build
pip install opencv-python
pip install imgaug
pip --no-cache-dir install sklearn

You can install all required packages with following command.

pip install -r requirements.txt

4. Building

4.1. Fix Bugs

  • First of all, this repository have an indentation error in line 242 of /CDCN/CVPR2020_paper_codes/ train_CDCN.py file. We must fix that problem.

  • Secondly, line 246 is "model = model.cuda()" in train_CDCN.py file and we changed to be comment line this line and add the following are to force CPU to be used :

      device=torch.device("cpu")
      	
      model.to(device)
    
  • Finally, add following codes to line 203

      os.environ["CUDA_VISIBLE_DEVICES"]=""
    

4.2. Building Training File

cd CDCN/CVPR2020_paper_codes
python3 train_CDCN.py

5. Create Map Images

In this step, we realize that we need map_images, so we will create mapped images from our dataset. We will use repository of PRNet-Depth-Generation to generate mapped images.

5.1. Preparing the enviroment

5.1.1 Get and install PRNet-Depth-Generation

Create a main folder for project:

mkdir PRNet-Map-Images-Generation 

Download:

cd PRNet-Map-Images-Generation 
git clone https://github.com/clks-wzz/PRNet-Depth-Generation.git

5.1.2 Create a folder for Python virtual environments

5.1.2.1. Download python3.8 -venv to create environment:

You must be in ./PRNet-Map-Images-Generation folder.

sudo apt install python3.8-venv

5.1.2.2. Create python environment

python3 -m venv prnet-env

5.1.2.3 Activate python environment

source prnet-env/bin/activate

5.2. Install essential packages that will be used by PRNet-Depth-Generation building

Install required packages:

pip install numpy
pip install scikit-image
pip install scipy
pip install opencv-python

You can install all required packages with following command.

pip install -r requirements.txt

5.3. Building

cd PRNet-Map-Images-Generation/PRNet-Depth-Generation
python3 Generate_Depth_Image.py

NOTE: In this, spot we have some errors about building.

nativelibwithqt's People

Contributors

busrasi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.