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-rego-plates-detection')
8model = YolosForObjectDetection.from_pretrained('nickmuchi/yolos-small-rego-plates-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.479 |
| Average Precision | (AP) @[ IoU=0.50 | area= all | maxDets=100 ] | 0.752 |
| Average Precision | (AP) @[ IoU=0.75 | area= all | maxDets=100 ] | 0.555 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.147 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.420 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.804 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] | 0.437 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] | 0.641 |
| 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.268 |
| 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.870 |