Image Recognition based Security System Project in Rust
This is an Image Recognition project that uses Rust as a primary language and Java language for writing AWS Lambda function that further uses the AWS Rekognition service to send back the level of image similarity. The project can be run on the Raspberry Pi by cross compiling the existing project, details of which are given in the Readme.
We thrive for the best and want you to contribute towards a better Project. See
CONTRIBUTING.md for giving your valuable feedbacks and contributions.
Setting up your environment
Building this project requires rustup, version 1.8.0 or more recent.
If you have an older version, run
rustup self update.
To install on Windows, download and run
then follow the onscreen instructions.
To install on other systems, run:
curl https://sh.rustup.rs -sSf | sh
This will also download the current stable version of Rust, which this project won’t use. To skip that step, run instead:
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none
tar -xzf kafka_2.12-2.2.0.tgz cd kafka_2.12-2.2.0
Start the server
Start the Kafka server
Create a topic
This creates a topic named
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic my-topic
The Kafka server should be up and running when you want to run the application.
For more information on Kafka, refer to the Kafka Quickstart
REGION is required by AWS which should match your Bucket's region.
You are required to add the same region in which you have your Bucket.
BUCKET_NAME is the bucket that stores all the clicked images.
CLICKED_IMAGE_PATH is the path to the clicked image that is taken by the camera of Raspberry Pi.
API_URL contains the API Gateway URL that is hit from this application and gets the result from AWS Lambda.
my-topic are the two variables required by Kafka.
export Consumers=my-group export Topic_Name=my-topic
IP_ADDRESS:PORT_NO refers to the socket where the Kafka runs.
RUST_LOG is required for loggers.
git clone https://github.com/KnoldusLabs/Hawk cd Hawk cargo build
The binary would be saved in
Cross-compilation build for Raspberry Pi
cargo build --target=armv7-unknown-linux-gnueabihf to get a cross compiled binary in
Running the binary
Then follow the instructions in the application.