-
Notifications
You must be signed in to change notification settings - Fork 12
06. Installation
Before you install the JusticeAI software, we recommend that you first install and configure Docker. You are then ready to fetch the codebase and begin installation.
The easiest, most consistent method for installing Docker on Ubuntu can be found at: https://get.docker.com/
run:
curl -fsSL https://get.docker.com -o get-docker.sh
followed by:
bash get-docker.sh
Once the above has been completed. Open a command prompt window and type the ‘docker’ command to confirm that the Docker service is available and returning the help guide.
Assuming docker has been installed run the following command and install the NVIDIA Docker runtime using the script in the main project folder [GPU LINUX ONLY]:
bash install_nvidia_docker.sh
Run:
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
then modify permissions:
sudo chmod +x /usr/local/bin/docker-compose
git clone https://github.com/benetech/VideoDeduplication.git
The default approach to build and run the application is to use docker-compose utility.
Shortcut commands to run the application are:
-
make run
- build and run application -
make stop
- stop application
The make run
will ask you the following questions:
- Location of your source video files
- Availability of Nvidia GPU support for Docker (see Enable GPU support for Docker)
- Whether you want to use pre-built images (dev/prod)
- Whether to encrypt secrets when using remote fingerprint repository sharing
The command above might throw an error if you already have postgres server running. If that's the case run systemctl stop postgresql
(Linux) before using docker-compose or choose alternative postgres-port by setting the BENETECH_PG_PORT
environment variable.
In order to run the main scripts, simply enter the app's docker container by running the following command:
docker exec -it videodeduplication_dedup-app_1 /bin/bash
Once within the container, run one of the main scripts.
Extract video signatures
python extract_features.py
Generate Matches
python generate_matches.py
Template Object Matching
python template_matching.py
Exif Extraction
python extract_exif.py
Single Video Processing
python process_video.py [FILE_PATH] [OUTPUT_DIR]
Arguments:
'FILE_PATH': Path to videofile
'OUTPUT_PATH': Path where the output of running the script will be saved [default: 'data/']
'--config', '-cp' : Path to the project config file [default:'config.yml']
'--save-frames' : Whether to save video frames [default:True]
'--save-features/--no-features': Whether to save features [default=True]
'--save-signatures/--no-signatures': Whether to save features [default = True]
'--save-db' : Whether to save features [default = True]
Once the docker-compose is running, you will be able to access the following:
- User interface on http://localhost:5000
- projects notebooks on http://localhost:8888
- pgAdmin on http://localhost:16543
You can check your running instances using this command:
sudo docker ps
Take note of the following names:
- Deduplication App ->
videodeduplication_dedup-app_1
- User Interface ->
videodeduplication_server_1
- Postgres Server ->
videodeduplication_postgres_1
- PgAdmin ->
videodeduplication_pgadmin-compose_1
In order to use pgAdmin, follow these instructions:
- Go to http://localhost:1643 and use the credentials as defined on the
docker-compose.yml
file. - Click create new server
- Choose a reference name for the server
- Go the connection tab and set the host name to
postgres
, maintenance database to "videodeduplicationdb" and user / password aspostgres
andadmin