Skip to content

Repository files navigation

Aerial GCP Pose Estimation

This repository contains a machine learning pipeline for localizing Ground Control Point (GCP) markers in high-resolution aerial images and classifying their shape (Cross, Square, L-Shaped).

Problem Statement

The goal is to analyze aerial images containing GCP markers, predict the exact (x, y) pixel coordinates of the center of these markers, and classify their shape into one of three predefined classes.

Features

  • Multi-task Learning: A unified model based on ResNet-34 that simultaneously predicts the keypoint coordinates (localization) and robustly classifies the token shape (classification) using two separate decision heads.
  • Efficient Handling of Large Imagery: Raw images (2048x1365) are automatically resized maintaining their keypoints coordinates scaling properties.
  • Lightweight Inference: Produces predictions seamlessly for missing markers.

Code Structure

  • dataset.py: Contains a PyTorch Dataset definition for parsing gcp_marks.json annotations and scaling coordinates dynamically.
  • model.py: Implements the GCPModel class, utilizing a pre-trained ResNet-34 backbone with separate heads for spatial layout and classification output.
  • train.py: The main loop orchestrating data-loading, validation splits, PCK metrics computation, loss summation (Smooth L1 Loss + CrossEntropy), & saving best model weights (best_gcp_model.pth).
  • inference.py: Evaluation pipeline strictly generating the structured predictions.json.
  • eda.py: Preliminary logic verifying bounding boxes distribution across categories & scanning corrupted samples.

Setup Instructions

Ensure you have a complete Python 3.9+ setup.

# Install required libraries
pip install torch torchvision numpy pandas matplotlib scikit-learn tqdm PIL

Running the Pipeline

1. Training from Scratch

Make sure the labeled dataset exists at data/GCP_Assignment_Datasets/train_dataset/. Then initialize the training block:

python train.py

2. Inferencing & Test Predictions

Ensure the unlabelled datasets exists at data/GCP_Assignment_Datasets/test_dataset/ and the trained weights best_gcp_model.pth sits within the directory. Start the validation mapping:

python inference.py

The predictions structure is fully available in predictions.json generated in the current workspace loop.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages