A CLI tool to grep for faces in images. Works with Aleph.
pip install .
cd docker/
docker-compose up -d
facegrep init
facegrep --help
facegrep entity add path/to/image.png
Optionally, you can tag the entity for the option to filter search by tag(s)
facegrep entity add path/to/image.png -t occrp
facegrep entity list
This returns JSONL new-line delimited objects you can do things with. Like use with jq.
facegrep entity search path/to/image.png
Optionally, you can filter the search to only search for entities containing one or more tags.
facegrep entity search path/to/image.png -t occrp -t fraud_factory
This stores any matches found into a report and returns a report ID you can use to list the records of the report.
facegrep report export -r $(facegrep entity search path/to/image.png)
You can also just list all the reports.
facegrep report list
This requires you have permission to read the entities in the dataset. To read more about using alephclient, check out its documentation. The main thing is to have the alephclient env variables set.
facegrep aleph search <entity_id>
This can take a while depending on the dataset. You can increase the number of workers accordingly.
facegrep aleph crawl -f <foreign_id> --workers 4
facegrep report export -r <report_id> -o json
This outputs JSONL new-line delimited JSON record objects. This is the default and the -o json is optional.
facegrep report export -r 42 -o neo4j
This will write the matched person and the source as nodes and the relationship between them as an edge. On a good day, this will enable you to see if someone is related to another person directly or indirectly via other people in images. You'll kneed to add set the env variables to connect to your neo4j database, as described in the settings.py file.