An AI-powered project aimed at improving urban safety by mapping crime hotspots. The system uses machine learning to predict crime-prone areas, supporting informed decision-making for individuals and law enforcement.
- Crime hotspot mapping using machine learning.
- Integration with Firebase for authentication and database management.
- An interactive map for visualizing crime hotspots for better clarity.
The dataset included in this repository is synthetic data and is not authentic. It has been created solely for the purpose of demonstrating the working of this project. The dataset should not be used as a source of real-world information or relied upon for decision-making.
Follow these steps to set up the project locally:
- Open a terminal or command prompt.
- Run the following command to clone the repository:
git clone https://github.com/AmanJ4588/SafeZone-AI.git
- Navigate to the cloned repository folder.
- Create a Python virtual environment.
- Activate the virtual environment
- Install the required dependencies from
requirements.txt
- Go to the Firebase Console
https://console.firebase.google.com
- Create a new Firebase project.
- Set up Cloud Firestore and Firebase Authentication:
- Enable Cloud Firestore in the database section.
- Configure Firebase Authentication (email/password).
- Retrieve the Firebase configuration object from your Firebase project's settings.
- Update the following files with your Firebase project's secret keys:
app.py: Add your Firebase Admin SDK private key and other required settings.index.html: Add your Firebase configuration object in the appropriate<script>tag.
- Execute the following command on the terminal with activated virtual env.
flask upload_data
- Execute the following command on the terminal with activated virtual env.
flask cluster_and_upload_to_firebase
- Open the terminal in your project directory.
- Make sure your virtual environment is activated.
- Run the Flask app using the following command:
flask run
- By default, the app will run on
http://127.0.0.1:5000