Location Classification of Indian Cities
This Streamlit app is designed to detect the location of an Indian city in an uploaded image. It uses a deep learning model trained on 10,500 images classified into 5 classes of cities including Ahmedabad, Delhi, Kerala, Kolkata, and Mumbai. The model was trained in association with Parul University and currently has a test accuracy of 66.3%.
How to Use the App
- Clone the GitHub repository:
git clone https://github.com/shahdivax/Location-Classification-of-Indian-Cities.git --branch master
- Install the required libraries:
pip install -r requirements.txt
- Run the app:
For Flask app:streamlit run app.py
change Directory
run app:cd Flask
flask run
Flask Demo:
https://huggingface.co/diabolic6045/indian_cities_image_classification/resolve/main/Demo.mp4
4. Upload an image in JPG or JPEG format.
5. The app will display the uploaded image and predict the location of the city in the image.
6. The predicted location and accuracy percentage will be displayed.
Please note that the app may not work accurately for images that are not clear or do not have a distinct view of the city's landmarks.
Live Demo
A live demo of the app is available here hosted with Streamlit.
Code
The code for this app was written in Python. It uses the following libraries:
- Streamlit: To build the app user interface
- TensorFlow and Keras: To load the pre-trained model and process images
- Numpy and Random: For data processing and random color selection
The application flow follows the steps below:
- Load the trained deep learning model.
- Define the class labels for the 5 Indian cities.
- Set a minimum accuracy threshold for predictions.
- Create a function to process uploaded images.
- Create a Streamlit app interface with a file uploader.
- Process uploaded images and display the predicted location and accuracy.
Future Work
This app can be improved by increasing the size of the training dataset and fine-tuning the pre-trained model to increase its accuracy. Additionally, the app can be trained to recognize city landmarks to improve its performance.
arXiv : https://arxiv.org/abs/2403.10912
@article{karangiya2024automatic,
title={Automatic location detection based on deep learning},
author={Karangiya, Anjali and Sharma, Anirudh and Shah, Divax and Badgujar, Kartavya and Thacker, Dr Chintan and Dave, Dainik},
journal={arXiv preprint arXiv:2403.10912},
year={2024}
}
- Downloads last month
- 10