This project predicts the geographic coordinates (latitude and longitude) of images using the k-Nearest Neighbors (k-NN) algorithm. The dataset comprises geo-tagged images from Flickr, and we leverage OpenAI's CLIP embeddings for image feature analysis.
- Predicts image locations using k-NN.
- Employs PCA for dimensionality reduction.
- Optimizes k-NN with grid search for the best k-value.
- Evaluates performance using Mean Displacement Error (MDE).
The following Python libraries are required:
- matplotlib
- numpy
- scikit-learn
- Clone the repository
- Navigate to the project directory
- Install dependencies
- Place the dataset file
im2spain_data.npzin the project directory. - Run the main script:
- Visualizations of image locations and features.
- Mean Displacement Error for different k-values.
- Comparison of k-NN with Linear Regression.
Ensure that the required Python libraries are installed before running the code. For any issues, please contact the project maintainer.