Skip to content
/ kafis Public

CLI application based on SourceAFIS for comparing fingerprint templates.

License

Notifications You must be signed in to change notification settings

caktus/kafis

Repository files navigation

Kotlin AFIS CLI

CLI application based on SourceAFIS for comparing fingerprint templates.

GraalVM installation

1a. With binary support

To build a native CLI binary on MacOS, you will need GraalVM >= 22 from Oracle. Follow GraalVM Installation on macOS Platforms instructions to install it. For example:

wget https://download.oracle.com/graalvm/22/latest/graalvm-jdk-22_macos-aarch64_bin.tar.gz
tar -xzf graalvm-jdk-22_macos-aarch64_bin.tar.gz
# Note, you may download a newer minor version; alter the commands below accordingly
sudo mv graalvm-jdk-22.0.2+9.1 /Library/Java/JavaVirtualMachines
rm graalvm-jdk-22_macos-aarch64_bin.tar.gz

Add to .envrc and run direnv allow to set the environment variables:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-jdk-22.0.2+9.1/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export GRAALVM_HOME=$JAVA_HOME

1b. Without binary support (via jabba)

If you don't need to compile a native binary, you can use Jabba as a JVM manager to install GraalVM:

# use Jabba to install GraalVM
jabba ls-remote | grep graalvm | grep 21
jabba install [email protected]

Add to .envrc and run direnv allow to set the environment variables:

source ~/.jabba/jabba.sh
export [email protected]
export JAVA_HOME=$(jabba which $JABBA_VM)/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export GRAALVM_HOME=$JAVA_HOME

Install the native-image command

Install the native-image utility using the Graal updater.

gu available
gu install native-image

2. Building and using CLI

Running with Gradle

./gradlew clean
./gradlew build
./run.sh --file-name=thumbprints.csv --thread-count=14 --output-score-limit=40 --subject-limit=1000

Building an uber jar

./gradlew clean
./gradlew uberJar
java -cp build/libs/kafis.jar com.smartelect.AppKt --file-name=thumbprints.csv --thread-count=14 --output-score-limit=40 --subject-limit=1000

Building a native image (not yet supported)

./gradlew build
./gradlew buildNativeImage

cd build/
./kafis --file-name=thumbprints.csv --thread-count=14 --output-score-limit=40

Docker image

docker build . -t kafis:latest
docker run \
  --mount=type=bind,source=${PWD}/thumbprints.csv,target=/app/thumbprints.csv \
  kafis:latest -- \
  java -cp /app/kafis.jar com.smartelect.AppKt \
  --file-name=/app/thumbprints.csv \
  --thread-count=14 \
  --output-score-limit=40 \
  --subject-limit=2000

Maintainer

Caktus Consulting Group, LLC

Thanks to @lreimer for the hands-on-clikt template used to start this repository.

License

This software is provided under the MIT open source license, read the LICENSE file for details.

About

CLI application based on SourceAFIS for comparing fingerprint templates.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages