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%.
- 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 Directoryrun app:cd Flask
flask run
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.
A live demo of the app is available here hosted with Streamlit. and here hosted with vercel.
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.
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.