Views
No views yet
1from transformers import YolosFeatureExtractor, YolosForObjectDetection
2from PIL import Image
3import requests
4
5url = 'https://drive.google.com/uc?id=1p9wJIqRz3W50e2f_A0D8ftla8hoXz4T5'
6image = Image.open(requests.get(url, stream=True).raw)
7feature_extractor = YolosFeatureExtractor.from_pretrained('nickmuchi/yolos-small-finetuned-license-plate-detection')
8model = YolosForObjectDetection.from_pretrained('nickmuchi/yolos-small-finetuned-license-plate-detection')
9inputs = feature_extractor(images=image, return_tensors="pt")
10outputs = model(**inputs)
11
12# model predicts bounding boxes and corresponding face mask detection classes
13logits = outputs.logits
14bboxes = outputs.pred_boxes| Metrics | Metric Parameter | Location | Dets | Value |
|---|---|---|---|---|
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] | 0.490 |
| Average Precision | (AP) @[ IoU=0.50 | area= all | maxDets=100 ] | 0.792 |
| Average Precision | (AP) @[ IoU=0.75 | area= all | maxDets=100 ] | 0.585 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.167 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.460 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.824 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] | 0.447 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] | 0.671 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] | 0.676 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.278 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.641 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.890 |