This project implements a Convolutional Neural Network (CNN) using TensorFlow.NET and C# to classify images into two categories: Suit and No Suit. It's ideal for applications like automated dress-code verification, video surveillance, or personal projects involving image recognition.
- CNN Model built with TensorFlow.NET Keras API
- Image Preprocessing (resizing, normalization)
- Eager Execution for straightforward debugging
- Training with Validation for accurate performance metrics
CNNTrainer/
├── vendor/
│ ├── ImageUtils.cs
│ └── ImageLoader.cs
├── CNNTrainer.cs
└── suit_classifier_model/ (generated after training)
- .NET 8.0 SDK
- TensorFlow.NET
- SciSharp.TensorFlow.Redist
Install via NuGet:
dotnet add package TensorFlow.NET
dotnet add package SciSharp.TensorFlow.Redist
Place your training and validation data in the following format:
Training CNN/
├── train/
│ ├── suit/
│ └── no_suit/
└── val/
├── suit/
└── no_suit/
To train the model, update the dataset paths in CNNTrainer.cs and run:
dotnet run
The trained model will be saved to:
suit_classifier_model/
Load and utilize your trained TensorFlow.NET model for predictions in your applications.
Feel free to fork the project and submit pull requests. Contributions and enhancements are welcome!
This project is open-source and licensed under the MIT License.