Upload an image to classify it with Hugging Face's ResNet-50 model and explore visually similar images via Google Custom Search. Built with ASP.NET Core and a modern responsive UI.
HTML
0
2 commits
updated Jun 9, 2025
π Academic Project β developed as part of Programming intelligent systems at University of Economics in Cracow.
This is a web application for classifying images and finding similar images using the power of machine learning models. The application allows users to upload an image, classify it using a pre-trained model, and display similar images fetched from Google Custom Search API.
ResNet-50 model.Ensure you have the following installed:
Clone the Repository
git clone https://github.com/calKU0/AIImageClassifier.git
cd AIImageClassifier
Install Dependencies
Run the following command to restore the required packages:
dotnet restore
Set up Configuration
Add your API keys and configuration to the appsettings.json file:
{
"HuggingFace": {
"ApiToken": "your_huggingface_api_token"
},
"Google": {
"ApiKey": "your_google_api_key",
"cx": "your_google_cx"
}
}
Run the Application
Once everything is set up, you can run the application using the following command:
dotnet run
The application will be available at http://localhost:5000.
Upload an Image
Image Upload: The user uploads an image via a form. The image is sent to the server.
Image Classification: The server sends the image to the Hugging Face API (microsoft/resnet-50 model) to classify the image. The response contains a label for the image along with a confidence score.
Similar Image Search: Using the label of the classified image, the application makes a request to the Google Custom Search API to find similar images.
Display Results: The classified label, confidence score, image preview, and similar images are displayed to the user in a modern, responsive UI.
AIImageClassifier/
βββ Controllers/
β βββ HomeController.cs # Handles image upload and classification logic
βββ Models/
β βββ ImageInputModel.cs # Model for handling the uploaded image and results
β βββ ClassificationResult.cs # Defines the classification result structure
βββ Services/
β βββ IImageClassifier.cs # Interface for image classification services
β βββ HuggingFaceImageClassifier.cs # Implements the classification logic using Hugging Face API
βββ Views/
β βββ Home/
β βββ Index.cshtml # View for image upload, preview, and results display
βββ appsettings.json # Application configuration (API Keys, etc.)
βββ Startup.cs # Application configuration and middleware setup
βββ Program.cs # Main entry point of the application
βββ README.md # This file
For searching similar images, the app uses Google Custom Search API. Ensure you set up your Google Custom Search Engine properly.
appsettings.json.ResNet-50 model is available in Hugging Face's model hub.cx value are correct.If you would like to contribute to this project, feel free to fork the repository, make your changes, and submit a pull request. Any contributions are welcome!
This project is licensed under the MIT License β see the LICENSE file for details.
Upload an image to classify it with Hugging Face's ResNet-50 model and explore visually similar images via Google Custom Search. Built with ASP.NET Core and a modern responsive UI.
HTML
0
2 commits
updated Jun 9, 2025
π Academic Project β developed as part of Programming intelligent systems at University of Economics in Cracow.
This is a web application for classifying images and finding similar images using the power of machine learning models. The application allows users to upload an image, classify it using a pre-trained model, and display similar images fetched from Google Custom Search API.
ResNet-50 model.Ensure you have the following installed:
Clone the Repository
git clone https://github.com/calKU0/AIImageClassifier.git
cd AIImageClassifier
Install Dependencies
Run the following command to restore the required packages:
dotnet restore
Set up Configuration
Add your API keys and configuration to the appsettings.json file:
{
"HuggingFace": {
"ApiToken": "your_huggingface_api_token"
},
"Google": {
"ApiKey": "your_google_api_key",
"cx": "your_google_cx"
}
}
Run the Application
Once everything is set up, you can run the application using the following command:
dotnet run
The application will be available at http://localhost:5000.
Upload an Image
Image Upload: The user uploads an image via a form. The image is sent to the server.
Image Classification: The server sends the image to the Hugging Face API (microsoft/resnet-50 model) to classify the image. The response contains a label for the image along with a confidence score.
Similar Image Search: Using the label of the classified image, the application makes a request to the Google Custom Search API to find similar images.
Display Results: The classified label, confidence score, image preview, and similar images are displayed to the user in a modern, responsive UI.
AIImageClassifier/
βββ Controllers/
β βββ HomeController.cs # Handles image upload and classification logic
βββ Models/
β βββ ImageInputModel.cs # Model for handling the uploaded image and results
β βββ ClassificationResult.cs # Defines the classification result structure
βββ Services/
β βββ IImageClassifier.cs # Interface for image classification services
β βββ HuggingFaceImageClassifier.cs # Implements the classification logic using Hugging Face API
βββ Views/
β βββ Home/
β βββ Index.cshtml # View for image upload, preview, and results display
βββ appsettings.json # Application configuration (API Keys, etc.)
βββ Startup.cs # Application configuration and middleware setup
βββ Program.cs # Main entry point of the application
βββ README.md # This file
For searching similar images, the app uses Google Custom Search API. Ensure you set up your Google Custom Search Engine properly.
appsettings.json.ResNet-50 model is available in Hugging Face's model hub.cx value are correct.If you would like to contribute to this project, feel free to fork the repository, make your changes, and submit a pull request. Any contributions are welcome!
This project is licensed under the MIT License β see the LICENSE file for details.