Pigo is a high-performance, open-source face detection library and command line tool written in Go programming language without any bindings to C/C++ libraries. This tutorial demonstrates how to install Pigo face detection tool on Ubuntu 24.04.
Install Pigo
Get the latest Pigo version tag from the GitHub repository and assign it to a variable:
PIGO_VERSION=$(curl -s "https://api.github.com/repos/esimov/pigo/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
Download the archive file with the version obtained earlier:
wget -qO pigo.tar.gz https://github.com/esimov/pigo/releases/latest/download/pigo-$PIGO_VERSION-linux-amd64.tar.gz
Create temporary directory and extract a tar.gz
file:
mkdir pigo-temp
tar xf pigo.tar.gz --strip-components=1 -C pigo-temp
Move executable to /usr/local/bin
directory:
sudo mv pigo-temp/pigo /usr/local/bin
Remove the unneeded archive and directory:
rm -rf pigo.tar.gz pigo-temp
Testing Pigo
Download image for testing:
wget -qO test.jpg https://raw.githubusercontent.com/esimov/pigo/master/testdata/sample.jpg
Download pretrained cascade model:
wget -qO facefinder https://raw.githubusercontent.com/esimov/pigo/master/cascade/facefinder
Run the following command to detect face in the image:
pigo -in test.jpg -out result.jpg -cf facefinder
Uninstall Pigo
To uninstall Pigo, delete the associated file:
sudo rm -rf /usr/local/bin/pigo
Leave a Comment
Cancel reply