{"id":30502442,"url":"https://github.com/0xnu/uklpr","last_synced_at":"2025-08-25T11:34:53.310Z","repository":{"id":310588509,"uuid":"1039950036","full_name":"0xnu/uklpr","owner":"0xnu","description":"UKLPR is a computer-vision model architecture purpose-built for detecting, reading, and recognizing United Kingdom license plates.","archived":false,"fork":false,"pushed_at":"2025-08-18T14:22:11.000Z","size":3469,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T03:51:45.341Z","etag":null,"topics":["computer-vision","image-recognition","object-detection","ocr","transport","transportation","uk","united-kingdom"],"latest_commit_sha":null,"homepage":"https://0xnu.github.io/uklpr/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xnu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-18T08:25:41.000Z","updated_at":"2025-08-18T14:22:14.000Z","dependencies_parsed_at":"2025-08-19T03:51:46.461Z","dependency_job_id":"b51437ec-c9a5-452d-9268-80b0dc39ab58","html_url":"https://github.com/0xnu/uklpr","commit_stats":null,"previous_names":["0xnu/uklpr"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/0xnu/uklpr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xnu%2Fuklpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xnu%2Fuklpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xnu%2Fuklpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xnu%2Fuklpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xnu","download_url":"https://codeload.github.com/0xnu/uklpr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xnu%2Fuklpr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272055235,"owners_count":24865333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","image-recognition","object-detection","ocr","transport","transportation","uk","united-kingdom"],"created_at":"2025-08-25T11:34:52.515Z","updated_at":"2025-08-25T11:34:53.297Z","avatar_url":"https://github.com/0xnu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## uklpr\n\n[![License](https://img.shields.io/badge/License-Modified_MIT-f5de53?\u0026color=f5de53)](/LICENSE)\n\nUKLPR is a computer-vision model architecture purpose-built for detecting, reading, and recognizing United Kingdom license plates. It is optimized for speed and accuracy across diverse UK plate formats.\n\n### Model Performance\n\n- **Detection Rate**: 100.0%\n- **Text Extraction Rate**: 100.0%\n- **Processing Speed**: 8.1 FPS\n- **Model Size**: YOLOv8 Nano (~12.3MB)\n\n### Supported Languages\n\n- English (en)\n\n### Quick Start\n\n#### Installation\n\n```python\npip install ultralytics easyocr opencv-python pillow torch torchvision huggingface_hub\n```\n\n#### Usage\n\n```python\nimport cv2\nimport numpy as np\nfrom ultralytics import YOLO\nimport easyocr\nfrom PIL import Image\nfrom huggingface_hub import hf_hub_download\nimport warnings\n\n# Suppress warnings\nwarnings.filterwarnings('ignore')\n\n# Download models from HuggingFace\nprint(\"Downloading model from HuggingFace...\")\nmodel_path = hf_hub_download(repo_id=\"0xnu/uk-license-plate-recognition\", filename=\"model.onnx\")\nconfig_path = hf_hub_download(repo_id=\"0xnu/uk-license-plate-recognition\", filename=\"config.json\")\n\n# Load models with explicit task specification\nyolo_model = YOLO(model_path, task='detect')\nocr_reader = easyocr.Reader(['en'], gpu=False, verbose=False)\n\n# Process image\ndef recognize_license_plate(image_path):\n   # Load image\n   image = cv2.imread(image_path)\n   image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n   \n   # Detect license plates\n   results = yolo_model(image_rgb, conf=0.5, verbose=False)\n   \n   plates = []\n   for result in results:\n       boxes = result.boxes\n       if boxes is not None:\n           for box in boxes:\n               # Get coordinates\n               x1, y1, x2, y2 = box.xyxy[0].cpu().numpy()\n               \n               # Crop plate\n               plate_crop = image_rgb[int(y1):int(y2), int(x1):int(x2)]\n               \n               # Extract text\n               ocr_results = ocr_reader.readtext(plate_crop)\n               if ocr_results:\n                   text = ocr_results[0][1]\n                   confidence = float(ocr_results[0][2])  # Convert to native Python float\n                   plates.append({'text': text, 'confidence': confidence})\n   \n   return plates\n\n# Usage Example\nresults = recognize_license_plate('sample_car_with_license.jpeg')\nprint(results)\n```\n\n### Model Architecture\n\n#### Detection Model (YOLOv8n)\n- **Architecture**: YOLOv8 Nano\n- **Parameters**: ~3M\n- **Input Size**: 640x640 pixels\n- **Output**: Bounding boxes for license plates\n\n#### OCR Model (EasyOCR)\n- **Engine**: Deep learning-based OCR\n- **Languages**: English\n- **Character Set**: Alphanumeric + common symbols\n\n### Training Details\n\n- **Dataset**: UK License Plate Dataset ([0xnu/uk-licence-plate](https://huggingface.co/datasets/0xnu/uk-licence-plate))\n- **Training Epochs**: 10\n- **Batch Size**: 16\n- **Image Size**: 640x640\n- **Optimizer**: AdamW\n- **Framework**: Ultralytics YOLOv8\n\n### Use Cases\n\n- Traffic monitoring systems\n- Automated parking management\n- Law enforcement applications\n- Toll collection systems\n- Vehicle access control\n\n### Limitations\n\n- Optimized for European license plate formats\n- Performance may vary with extreme weather conditions\n- Requires good image quality for optimal text recognition\n- Real-time performance depends on hardware capabilities\n\n### License\n\nThis project is licensed under the [Modified MIT License](./LICENSE).\n\n### Citation\n\nIf you use this model in your research or product, please cite:\n\n```bibtex\n@misc{uklpr2025,\n  title={UKLPR: United Kingdom License Plate Recognition},\n  author={Finbarrs Oketunji},\n  year={2025},\n  publisher={Hugging Face},\n  howpublished={\\url{https://huggingface.co/0xnu/uk-license-plate-recognition}}\n}\n```\n\n### Copyright\n\nCopyright (C) 2025 Finbarrs Oketunji. All Rights Reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xnu%2Fuklpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xnu%2Fuklpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xnu%2Fuklpr/lists"}