CoolFace
Apppublic

MLFinalProject/Final_Project_Object_Localization

sourceHugging Faceccupdated 7mo agoView on Hugging Face
0likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference


Object Localization — Bounding Box Prediction

Authors: Elizabeth Wangley and Henry Wang Course: CSCI 4750 - Machine Learning Date: May 12, 2025 Paper: Read the full paper Live Demo: Hugging Face Spaces


Overview

A Gradio web app that predicts bounding boxes around a stop sign in images using two ML models:

  • Linear Regression — Four separate models, one per coordinate (x, y, width, height)
  • MLP (Neural Network) — Single model predicting all four coordinates simultaneously

Images are resized to 64×64, converted to grayscale, and flattened as model input. The app displays the predicted box in red and the ground truth in green (when available).


Results

MetricLinear RegressionMLP
Avg. RMSE~7~3
Mean IoU0.5810.778

The MLP outperformed Linear Regression and was selected for deployment.


Usage

  1. 1.Upload an image
  2. 2.Select a model — MLP or Linear Regression
  3. 3.View the predicted bounding box vs. ground truth

Run Locally

bash
pip install -r requirements.txt
python app.py

Open http://127.0.0.1:7860 in your browser.


Project Structure

├── app.py
├── image_annotation.csv
├── mlp_bbox_model.pkl
├── linear_model_x.pkl
├── linear_model_y.pkl
├── linear_model_w.pkl
├── linear_model_h.pkl
├── requirements.txt
└── README.md

Installation & Running Locally

bash
git clone https://github.com/your-username/Final_Project_Object_Localization.git
cd Final_Project_Object_Localization
pip install -r requirements.txt
python app.py

Then open http://127.0.0.1:7860 in your browser.


Requirements

  • Python 3.8+
  • gradio
  • numpy
  • pandas
  • scikit-learn
  • scikit-image
  • matplotlib
  • joblib

Future Work

  • Explore additional model architectures and do a more thorough comparison of traditional ML vs. deep learning in terms of resource cost vs. accuracy.
  • Test a broader set of hyperparameters with stronger computing resources.
  • Investigate alternative hyperparameter tuning strategies (e.g., random search, Bayesian optimization) for efficiency.
  • Evaluate model robustness on images where the stop sign is partially visible or occluded.

References

  • Géron, Aurélien. Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow. O'Reilly Media, 2022.
  • "Hyperparameter Tuning in Linear Regression." GeeksforGeeks, July 1, 2024. https://www.geeksforgeeks.org/hyperparameter-tuning-in-linear-regression/
  • Nayda, Yuriy. "Object Detection Technology: How It Works and Where It's Used." SmartTek Solutions, Jan. 11, 2023. https://smarttek.solutions/blog/object-detection-technology/