BlackPymer2/BrawlStars-gameplay
Brawl Stars Gameplay Dataset & Models This repository contains labeled gameplay footage of Brawl Stars, along with trained computer vision models for detection and HP (health points) OCR. Contents YOLO Detection Model best.pt — Trained YOLO model weights (yolo26s architecture). Detects: player, enemy, powercube, powercube-box, wall, water, bush, zone. from ultralytics import YOLO model = YOLO("best.pt") results = model.predict("screenshot.png")… See the full description on the dataset page: https://huggingface.co/datasets/BlackPymer2/BrawlStars-gameplay.
Brawl Stars Gameplay Dataset & Models
This repository contains labeled gameplay footage of Brawl Stars, along with trained computer vision models for detection and HP (health points) OCR.
Contents
YOLO Detection Model
- `best.pt` — Trained YOLO model weights (yolo26s architecture). Detects: player, enemy, powercube, powercube-box, wall, water, bush, zone.
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.predict("screenshot.png")HP OCR Dataset
health_dataset/ — A labeled dataset of 3259 cropped HP regions extracted from gameplay frames:
images/— 100×115 px cropped HP bars (3-channel)labels.csv— Ground truth HP values (regression targets)labels_with_predictions.csv— Labels augmented with model predictions for unlabelled entries
Each filename encodes metadata: {source}_frame{number}_{player|enemy}_{instance_id}.jpg
Distribution
HP OCR Model
- `hp_crnn_best.pt` — CRNN (CNN + BiLSTM + CTC) for reading HP values from cropped health bars.
- Accuracy: 93.75% on the validation split.
Loading & Inference
import cv2
import torch
from train_hp import CRNN, preprocess, decode
model = CRNN()
model.load_state_dict(torch.load("hp_crnn_best.pt", map_location="cpu"))
model.eval()
# Load a cropped HP region
img = cv2.imread("health_dataset/images/frame_000306_player_0.jpg")
# Preprocess (grayscale, resize to H=48, normalize)
inp = torch.from_numpy(preprocess(img)).unsqueeze(0)
# Inference
with torch.no_grad():
logits = model(inp).permute(1, 0, 2)
pred_ids = logits.argmax(dim=2).permute(1, 0)[0]
hp_text = decode(pred_ids.tolist())
print(f"HP: {hp_text}")Training
The model is a lightweight CRNN trained via CTC loss on the HP dataset. See train_hp.py for the full training pipeline.
Video Demo
A video demonstrating the trained network in action is included in this repository.
License
Apache 2.0
