Skip to content

# facegrep A CLI tool to grep for faces in images. Works with Aleph.

License

Notifications You must be signed in to change notification settings

brrttwrks/facegrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

facegrep

A CLI tool to grep for faces in images. Works with Aleph.

Installation

pip install .

To launch pgvector database and neo4j database using Docker

cd docker/
docker-compose up -d

To init the database and create tables

facegrep init

Usage

Use help to list the commands and options

facegrep --help

Add entity to pgvector database for searching

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

List all entities you have in your pgvector database

facegrep entity list

This returns JSONL new-line delimited objects you can do things with. Like use with jq.

Search an image for matches against your pgvector database

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

Search an Image entity in Aleph against yoru pgvector database

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>

Search all the images in a dataset

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

Export report records

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.

About

# facegrep A CLI tool to grep for faces in images. Works with Aleph.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages