An open API service indexing awesome lists of open source software.

https://github.com/semihdervis/cat-emotion-classifier

Streamlit application that classifies the emotions of cats from uploaded images.
https://github.com/semihdervis/cat-emotion-classifier

emotion-classification streamlit vision-transformer

Last synced: 5 months ago
JSON representation

Streamlit application that classifies the emotions of cats from uploaded images.

Awesome Lists containing this project

README

          

# Cat Emotion Classifier

This is a Streamlit application that classifies the emotions of cats from uploaded images using a Vision Transformer (ViT) model.

You can try the application [here](https://cat-emotion-classifier.streamlit.app/).

## Examples

Angry Cat

Scared Cat

Surprised Cat

## Features

- Upload an image of a cat and classify its emotion.
- Display the uploaded image.
- Show the classification results as a horizontal bar chart with confidence scores for each class.

## Installation

1. Clone the repository:

```sh
git clone https://github.com/semihdervis/cat-emotion-classifier.git
cd cat-emotion-classifier
```

2. Create a virtual environment and activate it:

```sh
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
```

3. Install the required dependencies:

```sh
pip install -r requirements.txt
```

## Usage

1. Run the Streamlit app:

```sh
streamlit run app.py
```

2. Open your web browser and go to `http://localhost:8501`.

3. Upload an image of a cat and click the "Classify Image" button to see the classification results.

**Note:** The first prediction may take some time as the Vision Transformer (ViT) model needs to be loaded from Hugging Face.

## Model

The application uses a Vision Transformer (ViT) model fine-tuned for cat emotion classification, available on Hugging Face as [`semih-dervis/cat-emotion-classifier`](https://huggingface.co/semihdervis/cat-emotion-classifier).

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.