MLFinalProject/Final_Project_Object_Localization
0
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
The MLP outperformed Linear Regression and was selected for deployment.
Usage
- Upload an image
- Select a model — MLP or Linear Regression
- View the predicted bounding box vs. ground truth
Run Locally
pip install -r requirements.txt
python app.pyOpen 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.mdInstallation & Running Locally
git clone https://github.com/your-username/Final_Project_Object_Localization.git
cd Final_Project_Object_Localization
pip install -r requirements.txt
python app.pyThen 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/
