Downloads · 30 days
725
68% of all-time downloads
krotreaksmey/Yolo_Detect_khmer_math
Yolo_Detect_khmer_math is a object detection model from krotreaksmey. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as mit.
State-of-the-art YOLOv8 model for detecting Khmer printed text lines and mathematical formulas across MoEYS textbooks and exam papers.
Downloads · 30 days
725
68% of all-time downloads
All-time downloads
1.1K
Public
Repo size
2.6 GB
Likes
0
Public
Click a slice to open those files.
.zip2.5 GB · 95%
From the Hugging Face model README
State-of-the-art YOLOv8 model for detecting Khmer printed text lines and mathematical formulas across MoEYS textbooks and exam papers.
.pt, ~11.7 MB ONNX .onnx) optimized for edge and web execution.| Checkpoint Name | Version | Format | Key Metrics | Direct Download Link |
|---|---|---|---|---|
best.pt | v5.0 (Default Latest) | .pt (~6.2 MB) | mAP50: 96.78% | mAP50-95: 81.96% | Recall: 93.33% | Download best.pt |
best.onnx | v5.0 (ONNX Runtime) | .onnx (~11.7 MB) | Cross-platform Web/Desktop/Mobile ready | Download best.onnx |
best_khmer_V3dectect_96pct.pt | v5.0 (Archive) | .pt (~6.2 MB) | Dedicated checkpoint for khmer_V3dectect 30 epochs run | Download |
best_khmer_V3dectect_96pct.onnx | v5.0 (Archive ONNX) | .onnx (~11.7 MB) | Dedicated ONNX for khmer_V3dectect | Download |
best_khmer_Dectecv2_30e.pt | v4.0 | .pt (~6.2 MB) | mAP50: 91.22% | Recall: 86.58% | Download |
best_khmer_line_detect_43pct.pt | v3.1 | .pt (~5.9 MB) | Selected high-density lines | Download |
best_yolo_khmer_math_physics_v3.pt | v3.0 | .pt (~5.5 MB) | Math and Physics 54.4K images | Download |
best_yolo_khmer_math_v2.pt | v2.0 | .pt (~6.2 MB) | Math G7-G12 Full Textbooks | Download |
| Version | Epochs | mAP@50 | mAP@50-95 | Recall | Precision | Status |
|---|---|---|---|---|---|---|
| v5.0 (khmer_V3dectect) | 30 | 96.78% | 81.96% | 93.33% | 94.89% | Current Champion (SOTA) |
| v4.0 (Dectecv2) | 30 | 91.22% | 70.11% | 86.58% | 90.99% | Previous Stable |
| v3.1 (line_detect_43pct) | 20 | ~80.5% | 61.2% | 78.40% | 88.2% | Refined Lines |
| v3.0 (math_physics_v3) | 30 | 74.93% | 55.25% | 76.66% | 82.1% | Unified Curriculum |
| v2.0 (khmer_math_v2) | 30 | 83.83% | 64.85% | 79.26% | 85.0% | Math G7-G12 |
| v1.0 (Baseline OBB) | 20 | 43.31% | 29.62% | 50.36% | - | Initial Experiment |
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
# Download best model directly from Hugging Face
model_path = hf_hub_download(
repo_id="krotreaksmey/Yolo_Detect_khmer_math",
filename="best.pt"
)
# Load model
model = YOLO(model_path)
# Predict on full textbook or exam page
results = model.predict(
source="textbook_page.png",
conf=0.25,
iou=0.45,
imgsz=640
)
# Extract detected text/math lines
for r in results:
for box in r.boxes:
x1, y1, x2, y2 = box.xyxy[0].tolist()
conf = float(box.conf[0])
cls_id = int(box.cls[0])
print(f"Line detected at [{x1:.1f}, {y1:.1f}, {x2:.1f}, {y2:.1f}] (conf: {conf:.2f})")
import onnxruntime as ort
import numpy as np
from PIL import Image
from huggingface_hub import hf_hub_download
onnx_path = hf_hub_download(
repo_id="krotreaksmey/Yolo_Detect_khmer_math",
filename="best.onnx"
)
session = ort.InferenceSession(onnx_path)
# Preprocess image with 640x640 letterboxing
im = Image.open("textbook_page.png").convert("RGB")
w, h = im.size
scale = min(640 / w, 640 / h)
nw, nh = int(w * scale), int(h * scale)
im_resized = im.resize((nw, nh), Image.Resampling.BILINEAR)
padded = Image.new("RGB", (640, 640), (114, 114, 114))
pad_x = (640 - nw) // 2
pad_y = (640 - nh) // 2
padded.paste(im_resized, (pad_x, pad_y))
input_arr = np.array(padded, dtype=np.float32) / 255.0
input_arr = np.transpose(input_arr, (2, 0, 1))[np.newaxis, ...]
outputs = session.run(["output0"], {"images": input_arr})
predictions = outputs[0] # shape: (1, 5, 8400)

@misc{yolo_khmer_math_v5,
title={YOLO Khmer Math and Text Line Detection Model (v5.0)},
author={krotreaksmey},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/krotreaksmey/Yolo_Detect_khmer_math}
}