Create new file
Browse files
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- object-detection
|
| 5 |
+
- license-plate-detection
|
| 6 |
+
- vehicle-detection
|
| 7 |
+
datasets:
|
| 8 |
+
- coco
|
| 9 |
+
- license-plate-detection
|
| 10 |
+
widget:
|
| 11 |
+
- src: https://drive.google.com/uc?id=1VwYLbGak5c-2P5qdvfWVOeg7DTDYPbro
|
| 12 |
+
example_title: "City"
|
| 13 |
+
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg
|
| 14 |
+
example_title: "Parking"
|
| 15 |
+
metrics:
|
| 16 |
+
- average precision
|
| 17 |
+
- recall
|
| 18 |
+
- IOU
|
| 19 |
+
model-index:
|
| 20 |
+
- name: yolos-small-rego-plates-detection
|
| 21 |
+
results: []
|
| 22 |
+
---
|
| 23 |
+
# YOLOS (small-sized) model
|
| 24 |
+
The original YOLOS model was fine-tuned on COCO 2017 object detection (118k annotated images). It was introduced in the paper [You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection](https://arxiv.org/abs/2106.00666) by Fang et al. and first released in [this repository](https://github.com/hustvl/YOLOS).
|
| 25 |
+
This model was further fine-tuned on the [license plate dataset]("https://www.kaggle.com/datasets/andrewmvd/car-plate-detection") from Kaggle. The dataset consists of 735 images of annotations categorised as "vehicle" and "license-plate". The model was trained for 200 epochs on a single GPU using Google Colab
|
| 26 |
+
## Model description
|
| 27 |
+
YOLOS is a Vision Transformer (ViT) trained using the DETR loss. Despite its simplicity, a base-sized YOLOS model is able to achieve 42 AP on COCO validation 2017 (similar to DETR and more complex frameworks such as Faster R-CNN).
|
| 28 |
+
## Intended uses & limitations
|
| 29 |
+
You can use the raw model for object detection. See the [model hub](https://huggingface.co/models?search=hustvl/yolos) to look for all available YOLOS models.
|
| 30 |
+
### How to use
|
| 31 |
+
Here is how to use this model:
|
| 32 |
+
```python
|
| 33 |
+
from transformers import YolosFeatureExtractor, YolosForObjectDetection
|
| 34 |
+
from PIL import Image
|
| 35 |
+
import requests
|
| 36 |
+
url = 'https://drive.google.com/uc?id=1VwYLbGak5c-2P5qdvfWVOeg7DTDYPbro'
|
| 37 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
| 38 |
+
feature_extractor = YolosFeatureExtractor.from_pretrained('nickmuchi/yolos-small-rego-plates-detection')
|
| 39 |
+
model = YolosForObjectDetection.from_pretrained('nickmuchi/yolos-small-finetuned-masks')
|
| 40 |
+
inputs = feature_extractor(images=image, return_tensors="pt")
|
| 41 |
+
outputs = model(**inputs)
|
| 42 |
+
# model predicts bounding boxes and corresponding face mask detection classes
|
| 43 |
+
logits = outputs.logits
|
| 44 |
+
bboxes = outputs.pred_boxes
|
| 45 |
+
```
|
| 46 |
+
Currently, both the feature extractor and model support PyTorch.
|
| 47 |
+
## Training data
|
| 48 |
+
The YOLOS model was pre-trained on [ImageNet-1k](https://huggingface.co/datasets/imagenet2012) and fine-tuned on [COCO 2017 object detection](https://cocodataset.org/#download), a dataset consisting of 118k/5k annotated images for training/validation respectively.
|
| 49 |
+
### Training
|
| 50 |
+
This model was fine-tuned for 200 epochs on the [license plate dataset]("https://www.kaggle.com/datasets/andrewmvd/car-plate-detection").
|
| 51 |
+
## Evaluation results
|
| 52 |
+
This model achieves an AP (average precision) of **47.9**.
|
| 53 |
+
Accumulating evaluation results...
|
| 54 |
+
IoU metric: bbox
|
| 55 |
+
Metrics | Metric Parameter | Location | Dets | Value |
|
| 56 |
+
---------------- | --------------------- | ------------| ------------- | ----- |
|
| 57 |
+
Average Precision | (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] | 0.479 |
|
| 58 |
+
Average Precision | (AP) @[ IoU=0.50 | area= all | maxDets=100 ] | 0.752 |
|
| 59 |
+
Average Precision | (AP) @[ IoU=0.75 | area= all | maxDets=100 ] | 0.555 |
|
| 60 |
+
Average Precision | (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.147 |
|
| 61 |
+
Average Precision | (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.420 |
|
| 62 |
+
Average Precision | (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.804 |
|
| 63 |
+
Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] | 0.437 |
|
| 64 |
+
Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] | 0.641 |
|
| 65 |
+
Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] | 0.676 |
|
| 66 |
+
Average Recall | (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.268 |
|
| 67 |
+
Average Recall | (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.641 |
|
| 68 |
+
Average Recall | (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.870 |
|