Views
No views yet

Gameplay-Classcode-10 is a vision-language model fine-tuned from google/siglip2-base-patch16-224 using the SiglipForImageClassification architecture. It classifies gameplay screenshots or thumbnails into one of ten popular video game titles.
1Classification Report:
2 precision recall f1-score support
3
4 Among Us 0.9990 0.9920 0.9955 1000
5 Apex Legends 0.9737 0.9990 0.9862 1000
6 Fortnite 0.9960 0.9910 0.9935 1000
7 Forza Horizon 0.9990 0.9820 0.9904 1000
8 Free Fire 0.9930 0.9860 0.9895 1000
9Genshin Impact 0.9831 0.9890 0.9860 1000
10 God of War 0.9930 0.9930 0.9930 1000
11 Minecraft 0.9990 0.9990 0.9990 1000
12 Roblox 0.9832 0.9960 0.9896 1000
13 Terraria 1.0000 0.9910 0.9955 1000
14
15 accuracy 0.9918 10000
16 macro avg 0.9919 0.9918 0.9918 10000
17 weighted avg 0.9919 0.9918 0.9918 10000
!pip install -q transformers torch pillow gradio1import gradio as gr
2from transformers import AutoImageProcessor, SiglipForImageClassification
3from PIL import Image
4import torch
5
6# Load model and processor
7model_name = "prithivMLmods/Gameplay-Classcode-10" # Replace with your actual model path
8model = SiglipForImageClassification.from_pretrained(model_name)
9processor = AutoImageProcessor.from_pretrained(model_name)
10
11# Label mapping
12id2label = {
13 0: "Among Us",
14 1: "Apex Legends",
15 2: "Fortnite",
16 3: "Forza Horizon",
17 4: "Free Fire",
18 5: "Genshin Impact",
19 6: "God of War",
20 7: "Minecraft",
21 8: "Roblox",
22 9: "Terraria"
23}
24
25def classify_game(image):
26 """Predicts the game title based on the gameplay image."""
27 image = Image.fromarray(image).convert("RGB")
28 inputs = processor(images=image, return_tensors="pt")
29
30 with torch.no_grad():
31 outputs = model(**inputs)
32 logits = outputs.logits
33 probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
34
35 predictions = {id2label[i]: round(probs[i], 3) for i in range(len(probs))}
36 predictions = dict(sorted(predictions.items(), key=lambda item: item[1], reverse=True))
37 return predictions
38
39# Gradio interface
40iface = gr.Interface(
41 fn=classify_game,
42 inputs=gr.Image(type="numpy"),
43 outputs=gr.Label(label="Game Prediction Scores"),
44 title="Gameplay-Classcode-10",
45 description="Upload a gameplay screenshot or thumbnail to identify the game title (Among Us, Fortnite, Minecraft, etc.)."
46)
47
48# Launch the app
49if __name__ == "__main__":
50 iface.launch()