Downloads · 30 days
0
crie123/yolov3s-finetuned-kyrgyz-plates
yolov3s-finetuned-kyrgyz-plates is a machine learning model from crie123. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as gpl-3.0.
This repository provides a fine-tuned version of YOLOv3n trained on a small custom dataset of Kyrgyz vehicle license plates. The model is intended as a demonstration of fine-tuning YOLOv3 rather than a production-read…
Downloads · 30 days
0
Access
Public
Updated Aug 24, 2025
Repo size
6.5 MB
Likes
0
Public
Click a slice to open those files.
.pt6.2 MB · 96%
From the Hugging Face model README
This repository provides a fine-tuned version of YOLOv3n trained on a small custom dataset of Kyrgyz vehicle license plates.
The model is intended as a demonstration of fine-tuning YOLOv3 rather than a production-ready solution.
⚠️ Note: The dataset is small (~478 images), so the model may not generalize well outside the training conditions.
For robust license plate detection in production, a larger and more diverse dataset is recommended.
Below is an example training script used to fine-tune YOLOv8n on the Kyrgyz License Plates dataset.
It performs dataset extraction, train/validation split (80/20), YAML generation, and launches training.
import os
import zipfile
import random
import glob
import shutil
from ultralytics import YOLO
# === 1. Extract dataset ===
extract_path = "./datasets/kyrgyz-plates"
zip_path = "./datasets/kyrgyz-car-license-plates.zip"
if os.path.exists(zip_path) and not os.path.exists(extract_path):
with zipfile.ZipFile(zip_path, "r") as z:
z.extractall(extract_path)
# === 2. Split into train/val (80/20) ===
images_src = os.path.join(extract_path, "images")
train_images = os.path.join(extract_path, "train", "images")
train_labels = os.path.join(extract_path, "train", "labels")
val_images = os.path.join(extract_path, "valid", "images")
val_labels = os.path.join(extract_path, "valid", "labels")
for p in (train_images, train_labels, val_images, val_labels):
os.makedirs(p, exist_ok=True)
img_exts = (".jpg", ".jpeg", ".png", ".bmp")
images = [p for p in glob.glob(os.path.join(images_src, "*")) if os.path.splitext(p)[1].lower() in img_exts]
random.seed(42)
random.shuffle(images)
split_idx = int(len(images) * 0.8)
train_list = images[:split_idx]
val_list = images[split_idx:]
def copy_items(lst, dest_img_dir, dest_lbl_dir):
for img_path in lst:
base = os.path.basename(img_path)
shutil.copy2(img_path, os.path.join(dest_img_dir, base))
lbl_src = os.path.splitext(img_path)[0] + ".txt"
if os.path.exists(lbl_src):
shutil.copy2(lbl_src, os.path.join(dest_lbl_dir, os.path.basename(lbl_src)))
copy_items(train_list, train_images, train_labels)
copy_items(val_list, val_images, val_labels)
# === 3. Write data.yaml ===
yaml_path = os.path.join(extract_path, "data.yaml")
with open(yaml_path, "w") as f:
f.write(f"""
path: {extract_path}
train: train/images
val: valid/images
names:
0: plate
""")
# === 4. Train YOLOv8n ===
model = YOLO("yolov8n.pt") # automatically downloads if missing
model.train(
data=yaml_path,
epochs=50,
imgsz=640,
batch=16,
name="yolo-plates-kg"
)
# Locate best weights
best_weights = glob.glob("runs/detect/yolo-plates-kg*/weights/best.pt")[-1]
print("Best weights:", best_weights)
## Training Results
Training metrics and figures (loss curves, mAP, PR/F1 curves) are available in the repository:
- `results.png` – combined training loss and mAP over epochs
You can view or download these images directly from the repository files.