This repository provides a setup to run YOLO-based object detection, integrated with IPFS for decentralized file storage, and an AWS Lambda function for managing detections via API Gateway. Follow the steps below to set up and run the project.
- Clone the Repository
- Set Up Virtual Environment
- Install Dependencies
- Prepare YOLO Models
- Install IPFS
- Set Up DynamoDB and CLI
- Create AWS Lambda Function
- Run Detection and Control Station
Clone this repository to your local machine:
git clone https://github.com/wepandas4/Crime-Detection.git
cd Crime-DetectionMake sure you have Python 3.11 installed on your system. Then, create a virtual environment:
python3.11 -m venv venv
venv\Scripts\activate # On Linux, use `source venv/bin/activate`With the virtual environment activated, install the required packages:
pip install -r requirements.txt-
Create a directory to store your YOLO models:
mkdir models
-
Place your YOLO model files in the
modelsdirectory. Ensure they are correctly named and compatible with the code.
Install IPFS Desktop and IPFS CLI (also known as IPFS Kubo) as follows:
-
Download IPFS Desktop from IPFS Desktop Downloads.
-
Install IPFS Kubo (CLI):
- Follow the official instructions for installing Kubo from IPFS Kubo.
- Once installed, you can initialize IPFS with the following command:
ipfs init
- To start the IPFS daemon:
ipfs daemon
-
Create a DynamoDB Table:
- Go to the AWS DynamoDB Console.
- Create a new table with the desired primary key and attributes same as in
pushHash.py.
-
Install AWS CLI:
- Follow the instructions on Installing the AWS CLI.
- Configure the AWS CLI with your credentials:
aws configure
- You can now manage DynamoDB and other AWS services from the command line.
-
Create a Lambda Function:
- In the AWS Lambda Console, create a new Lambda function.
- Upload
lambda_function.pyas the function code for processing. - Set up an API Gateway trigger for the function, which will allow it to be called via HTTP requests.
-
Integrate Lambda in Control Station:
- Use the API Gateway endpoint in
Control Station/app.pyto connect the Lambda function for API calls from the application.
- Use the API Gateway endpoint in
-
Start the main detection script:
python main.py
-
Run the Control Station (Flask app):
cd "Control Station" flask run
-
After detection completes, stop
main.pyby terminating the process.
Your setup is complete! You can now start detecting objects with YOLO and manage results through the Control Station interface.
This project was developed by our dedicated team. We are proud of our collective efforts and the innovative solutions we've created!
| Team Member | GitHub Profile | |
|---|---|---|
| Priyanka M K | Priyaaaa2 | priyankamk2903@gmail.com |
| Sumukh C | Sumu004 | sumukhchaluvaraj@gmail.com |
| Ravi J Gowda | RaviGowda29 | ravigowdaedu29@gmail.com |
| Yashwanth M | yashwanthm3012 | dev.yashwanthm3012@gmail.com |
We appreciate the hard work and collaboration that made this project possible!