Installation

recops developed on x64 Linux box using Python version 3.10.2. Is expected to work flawlessly on every linux box with Python versions above 3.7. In order to run on other systems we suggest to use the Dockerized version.

First of all we clone recops repository:

git clone https://github.com/forensic-toolkit/recops/
cd recops

MANUAL INSTALLATION

In order to install recops we will create a python virtual environment, setup required libraries, and download the pre-trained models.

Create virtual environment for python:

# Create a directory
mkdir -p ~/.recops/

# Create python virtual environment
python -m venv ~/.recops/venv

# Activate python virtual environment
source  ~/.venv/bin/activate

# Upgrade pip
pip install --upgrade pip

Install requirements and recops:

# Install recops requirements
pip install -r  requirements.txt

# Install recops
python setup.py install

Download the pre-trained models:

recops-download-models.sh

DOCKER INSTALLATION

In order to install recops we will build a docker image, and run it:

# Build docker image
docker build -t recops .

# Run docker image
docker run -it recops --help 

By default the docker image stores its data under /var/lib/recops inside the container. To persist the data use the -v option:

docker run -v /full/path/to/perstist:/var/lib/recops -it recops --help

If you want to get a bash shell to your container you can change the entrypoint:

docker run --entrypoint /bin/bash -it recops

Last but not least it might be helpful to run the docker container in the background using the webui command and execute recops at the running container like so:

docker run \
  --name my-recops \
  --volume /tmp/my-data:/var/lib/recops \
  --publish 127.0.0.1:5000:5000 \
  --detach recops webui --host 0.0.0.0

# Open web-ui on our browser
firefox http://127.0.0.1:5000

# Execute recops command on running container
docker exec -it my-recops recops --help

FILE STRUCTURE

Following is the default list of filepaths where recops stores data.

~/.recops/venv/..        => Default location of python virtualenv (see above for installation)
~/.recops/data           => Default location where recops stores its data.
~/.recops/data/recops.db => Default Sqlite DB location. 
~/.deepface/weights      => Deepface library uses this location to store pre-trained models.

In order to change the location of the database and files you can specify following environment variables:

export STORAGE_URI=file:///run/media/my-external-hard-disk/data
export DATABASE_URI=sqlite:////run/media/my-external-hard-disk/data/recops.db

When your dataset contains sensitive data you might want to move ~/.recops/data to an encrypted LUKS container or another location of an external hard drive. See this simple guide on how to do so.

USAGE

Usage: recops [OPTIONS] COMMAND [ARGS] ...

Options:

  --log-level TEXT  Specify logging level
  --log-file TEXT   Specify file to output logs (by default stderr)
  --help            Show this message and exit.

Commands:

  backup                          Backup full database and files.
  dataset-cluster-faces           Cluster faces for given dataset
  dataset-compute-extended-fields Use extended models to compute...
  dataset-create                  Create dataset
  dataset-delete                  Delete specified dataset and all...
  dataset-export                  Export datasets content into a zip...
  dataset-import-faces            Import faces from local folder
  dataset-import-identities       Import faces linked to identities from...
  dataset-import-images           Import images from local folder
  dataset-link-matched-faces      Link faces to identities from given...
  dataset-list                    List available datasets
  dataset-list-faces              List available faces in dataset
  dataset-list-identities         List available identities in dataset
  dataset-list-images             List available images in dataset
  dataset-match-faces             Compare faces linked to identity with...
  debug
  face-delete                     Delete a face
  identity-create                 Create an identity
  identity-delete                 Delete an identity
  identity-link                   Link existing identity to a face
  image-delete                    Delete an image
  recognize                       Runs face recognition on a given image...
  verify                          Runs face verification on a given...
  webui

NOTE: recops is still under development and code is subject to major changes. Please keep in mind that the release version 0.1.5 is a BETA version.

This document here thoroughly explains recops internals, design and functionality, we suggest reading it to get a deeper understanding.