Skip to content

Conversation

@Mandar808
Copy link

@Mandar808 Mandar808 commented Apr 6, 2025

🔄 Pull Request: Shape Classification using Zernike Moments with NLP Extension

This PR introduces a comprehensive example for shape classification using Zernike Moments on a custom image dataset (circles, squares, triangles), with an additional NLP-based interaction mode.


✅ Key Contributions:

🧠 Core Features:

  • examples/shape_classifier.py
    → Trains an SVM classifier using Zernike Moments extracted from shape images.
    → Includes prediction confidence metrics and visualizations.

  • shape_app.py
    → A Streamlit web app that allows users to classify shapes by uploading an image.
    Enhanced to accept natural language text input and classify shapes based on textual descriptions (e.g., "three sides", "perfectly round").

  • text_to_shape_classifier.joblib
    → An NLP-based classifier trained to map textual shape descriptions to shape labels, enabling a novel text-to-shape prediction capability.

  • Visual Confidence Tools
    → Added confidence_plot.png and confidence_histogram.png to visualize prediction certainty per sample and per class.

  • datasets/shapes/
    → Sample dataset of binary shape images used for training.

  • Trained Models
    zernike_shape_svm_model.joblib for image-based classification
    label_encoder.joblib for label decoding
    text_to_shape_classifier.joblib for NLP-driven shape understanding


🧠 🔤 NLP Integration:

This project now bridges vision and language by allowing users to describe a shape using plain English, which is classified using an NLP pipeline.
This represents a unique cross-domain enhancement—using natural language understanding (NLU) to trigger shape classification in a computer vision pipeline.


📚 README:

Instructions updated with:

  • How to run the shape classifier via image or text input
  • Model usage and architecture
  • Setup steps for running the Streamlit app

🚀 Summary:

This PR enhances the pyfeats library by:

  • Providing an end-to-end demo of Zernike moment-based shape recognition
  • Introducing a novel text-to-vision pipeline via NLP
  • Making the solution easily explorable through a Streamlit app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant