Star Classifier is an interactive web application built using Flask that allows users to predict the type of a star based on its astronomical properties such as temperature, luminosity, radius, magnitude, color, and spectral class.
The model is trained to classify stars into one of six categories:
- π Brown Dwarf
- π΄ Red Dwarf
- βͺ White Dwarf
- βοΈ Main Sequence
- π Supergiant
- π₯ Hypergiant
Each prediction is accompanied by an informative description, fun facts, and a dynamically displayed animation-style video to help users visualize the star type!
The backend uses a Voting Classifier composed of several base models (like Decision Trees, KNN, and Random Forests). The model is trained on a balanced dataset with features encoded to match the trained environment.
- Python 3.7+
- Flask
- NumPy
- Scikit-learn
- Pickle
git clone https://github.com/your-username/star-classifier.git
cd star-classifierWe recommend using a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtstar-classifier/
β
βββ static/
β βββ videos/ # MP4 videos named after star types (e.g., Brown_Dwarf.mp4)
β
βββ templates/
β βββ index.html # Frontend form + canvas animation + star info
β
βββ voting_classifier_model.pkl # Trained model
βββ app.py # Flask backend
βββ README.md # This file
βββ requirements.txt # Python dependencies
python app.pyThen visit: http://127.0.0.1:5000 in your browser.
Place your video files inside the static/videos/ folder, with filenames exactly matching the star prediction labels:
Brown_Dwarf.mp4Red_Dwarf.mp4White_Dwarf.mp4Main_Sequence.mp4Super_Giants.mp4Hyper_Giants.mp4
- Frontend: HTML5, JavaScript, CSS (Canvas animations)
- Backend: Python, Flask
- ML Libraries: scikit-learn, NumPy
- Visualization: HTML5 Video & JSON-driven UI updates
Cosmic.Classifier.-.Star.Type.Prediction.-.Google.Chrome.2025-04-13.01-45-03.online-video-cutter.com.mp4
- Fork this repository
- Create a new branch (
git checkout -b feature-name) - Commit your changes (
git commit -am 'Add feature') - Push to the branch (
git push origin feature-name) - Create a Pull Request
This project is licensed under the MIT License.

