yolos small finetuned license plate detection

nickmuchi

Introduction

The YOLOS-SMALL-FINETUNED-LICENSE-PLATE-DETECTION model is a fine-tuned version of the YOLOS (You Only Look One-level Series) model, specifically adapted for detecting license plates in images. It originates from the hustvl/yolos-small model and has been fine-tuned using a dataset from Roboflow containing 5200 training images and 380 validation images. The original YOLOS model was trained on the COCO 2017 dataset.

Architecture

YOLOS leverages a Vision Transformer (ViT) architecture and is trained using the DETR (Detection Transformer) loss. Despite its simplicity, the base-sized YOLOS model achieves competitive performance, with a 42 AP on the COCO 2017 validation set, comparable to more complex models like Faster R-CNN.

Training

The model was initially pre-trained on ImageNet-1k and then fine-tuned on the COCO 2017 dataset. For the specific task of license plate detection, the model underwent 200 epochs of fine-tuning using the license-plate-recognition dataset from Roboflow.

Guide: Running Locally

To run the model locally, follow these steps:

  1. Install Dependencies: Ensure you have transformers, torch, PIL, and requests installed.
  2. Load the Model:
    from transformers import YolosFeatureExtractor, YolosForObjectDetection
    from PIL import Image
    import requests
    
    url = 'https://drive.google.com/uc?id=1p9wJIqRz3W50e2f_A0D8ftla8hoXz4T5'
    image = Image.open(requests.get(url, stream=True).raw)
    feature_extractor = YolosFeatureExtractor.from_pretrained('nickmuchi/yolos-small-finetuned-license-plate-detection')
    model = YolosForObjectDetection.from_pretrained('nickmuchi/yolos-small-finetuned-license-plate-detection')
    inputs = feature_extractor(images=image, return_tensors="pt")
    outputs = model(**inputs)
    
    logits = outputs.logits
    bboxes = outputs.pred_boxes
    
  3. Run Inference: Use the model to predict bounding boxes and detect license plates in images.

For enhanced performance, especially with large datasets or batch processing, consider using cloud GPU services such as AWS, Google Cloud, or Azure.

License

The model is likely shared under a license specific to Hugging Face community models. Users should check the Hugging Face model page for detailed licensing information.

More Related APIs in Object Detection