Install P4 Detect

P4 Detect is an optional Python-based REST service that provides an API for image tagging using OpenAI's CLIP model.

After you have installed P4 Detect, you can configure it. See Configure P4 Detect.

Do not expose P4 Detect to the public internet.

Before you begin

  • You must have installed and done an initial configuration of P4 Search.

  • Ensure that you meet the system requirements. Each instance of P4 Detect needs at least 16GB of RAM and two CPUs.

  • Your host system must support Docker, and the user deploying the Docker container must have permissions to access Docker. To learn more, see:

Install P4 Detect with Docker

P4 Detect is provided as a P4 Detect Docker image.

To launch P4 Detect with Docker, run the following Docker commands on your local host:

  1. Fetch the P4 Detect Docker container:

    docker pull perforce/p4detect:latest

  2. Run the P4 Detect service with or without mounting the default volumes. Mounting the default volumes allows you to choose your own image tagging labels.

    • Run without mounting the default volumes:

      docker run -d --name p4detect.helix -p 1608:1608 perforce/p4detect:latest

      where p4detect.helix is the name of the running container.

    • Run with mounting the default volumes:

      Choose a location to create mount points and run the following:

      mkdir -p volumes/p4detect/config
      mkdir -p volumes/p4detect/label_config
      mkdir -p volumes/p4detect/logs
      
      docker run  -d \
          --name p4detect.helix \
          -p 1608:1608 \
          -v ./volumes/p4detect/config:/config \
          -v ./volumes/p4detect/label_config:/label_config \
          -v ./volumes/p4detect/logs:/logs \
          -e WORKERS=1 \
          -e CONFIG_ENV=production \
          -e CONFIG_PATH=/config/config.yml \
          -e LABEL_CONFIG_PATH=/label_config \
          -e LOGGING_PATH=/logs/P4Detect.log \
          -e HOST_UID=$(id -u) \
          -e HOST_GID=$(id -g) \
          perforce/p4detect:latest

      where p4detect.helix is the name of the running container.

  3. (Optional:) Configure P4 Detect.

  4. Verify the installation. Replace <your-host> with your host:

    http://<your-host>:1608/healthy

Next steps