|
|
--- |
|
|
license: apache-2.0 |
|
|
datasets: |
|
|
- strangerzonehf/Super-Emojies-DLC |
|
|
language: |
|
|
- en |
|
|
base_model: |
|
|
- google/siglip2-base-patch16-224 |
|
|
pipeline_tag: image-classification |
|
|
library_name: transformers |
|
|
tags: |
|
|
- Emoji-Scope |
|
|
- Google |
|
|
- CrossEmoji Classifier |
|
|
--- |
|
|
|
|
|
 |
|
|
|
|
|
# **Emoji-Scope** |
|
|
|
|
|
> **Emoji-Scope** is an image classification vision-language encoder model fine-tuned from **google/siglip2-base-patch16-224** for a single-label classification task. It is designed to classify emoji images into different style categories using the **SiglipForImageClassification** architecture. |
|
|
|
|
|
```py |
|
|
Classification Report: |
|
|
precision recall f1-score support |
|
|
|
|
|
Apple Style 0.9336 0.8538 0.8919 725 |
|
|
DoCoMo Style 0.9130 0.8400 0.8750 100 |
|
|
Facebook Style 0.8713 0.8915 0.8813 691 |
|
|
Gmail Style 0.8289 0.8750 0.8514 288 |
|
|
Google Style 0.8725 0.9505 0.9098 727 |
|
|
JoyPixels Style 0.8960 0.9614 0.9276 726 |
|
|
KDDI Style 0.9444 0.9333 0.9389 255 |
|
|
Samsung Style 0.9584 0.9681 0.9632 690 |
|
|
SoftBank Style 0.8407 0.8053 0.8226 190 |
|
|
Twitter Style 0.9939 0.8900 0.9390 727 |
|
|
Windows Style 0.9949 0.9949 0.9949 583 |
|
|
|
|
|
accuracy 0.9200 5702 |
|
|
macro avg 0.9134 0.9058 0.9087 5702 |
|
|
weighted avg 0.9222 0.9200 0.9201 5702 |
|
|
``` |
|
|
|
|
|
 |
|
|
|
|
|
The model categorizes images into eleven emoji styles: |
|
|
- **Class 0:** "Apple Style" |
|
|
- **Class 1:** "DoCoMo Style" |
|
|
- **Class 2:** "Facebook Style" |
|
|
- **Class 3:** "Gmail Style" |
|
|
- **Class 4:** "Google Style" |
|
|
- **Class 5:** "JoyPixels Style" |
|
|
- **Class 6:** "KDDI Style" |
|
|
- **Class 7:** "Samsung Style" |
|
|
- **Class 8:** "SoftBank Style" |
|
|
- **Class 9:** "Twitter Style" |
|
|
- **Class 10:** "Windows Style" |
|
|
|
|
|
# **Run with Transformers🤗** |
|
|
|
|
|
```python |
|
|
!pip install -q transformers torch pillow gradio |
|
|
``` |
|
|
|
|
|
```python |
|
|
import gradio as gr |
|
|
from transformers import AutoImageProcessor |
|
|
from transformers import SiglipForImageClassification |
|
|
from transformers.image_utils import load_image |
|
|
from PIL import Image |
|
|
import torch |
|
|
|
|
|
# Load model and processor |
|
|
model_name = "prithivMLmods/Emoji-Scope" |
|
|
model = SiglipForImageClassification.from_pretrained(model_name) |
|
|
processor = AutoImageProcessor.from_pretrained(model_name) |
|
|
|
|
|
def emoji_classification(image): |
|
|
"""Predicts the style category of an emoji image.""" |
|
|
image = Image.fromarray(image).convert("RGB") |
|
|
inputs = processor(images=image, return_tensors="pt") |
|
|
|
|
|
with torch.no_grad(): |
|
|
outputs = model(**inputs) |
|
|
logits = outputs.logits |
|
|
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist() |
|
|
|
|
|
labels = { |
|
|
"0": "Apple Style", |
|
|
"1": "DoCoMo Style", |
|
|
"2": "Facebook Style", |
|
|
"3": "Gmail Style", |
|
|
"4": "Google Style", |
|
|
"5": "JoyPixels Style", |
|
|
"6": "KDDI Style", |
|
|
"7": "Samsung Style", |
|
|
"8": "SoftBank Style", |
|
|
"9": "Twitter Style", |
|
|
"10": "Windows Style" |
|
|
} |
|
|
predictions = {labels[str(i)]: round(probs[i], 3) for i in range(len(probs))} |
|
|
|
|
|
return predictions |
|
|
|
|
|
# Create Gradio interface |
|
|
iface = gr.Interface( |
|
|
fn=emoji_classification, |
|
|
inputs=gr.Image(type="numpy"), |
|
|
outputs=gr.Label(label="Prediction Scores"), |
|
|
title="Emoji Style Classification", |
|
|
description="Upload an emoji image to classify its style." |
|
|
) |
|
|
|
|
|
# Launch the app |
|
|
if __name__ == "__main__": |
|
|
iface.launch() |
|
|
``` |
|
|
|
|
|
# **Intended Use:** |
|
|
|
|
|
The **Emoji-Scope** model is designed to classify emoji images based on different style categories. Potential use cases include: |
|
|
|
|
|
- **Emoji Standardization:** Identifying different emoji styles across platforms. |
|
|
- **User Experience Design:** Helping developers ensure consistency in emoji usage. |
|
|
- **Digital Art & Design:** Assisting artists in selecting preferred emoji styles. |
|
|
- **Educational Purposes:** Teaching differences in emoji representation. |