Views
No views yet
1from transformers import YolosFeatureExtractor, YolosForObjectDetection
2from PIL import Image
3import requests
4url = 'https://drive.google.com/uc?id=1VwYLbGak5c-2P5qdvfWVOeg7DTDYPbro'
5image = Image.open(requests.get(url, stream=True).raw)
6feature_extractor = YolosFeatureExtractor.from_pretrained('nickmuchi/yolos-small-finetuned-masks')
7model = YolosForObjectDetection.from_pretrained('nickmuchi/yolos-small-finetuned-masks')
8inputs = feature_extractor(images=image, return_tensors="pt")
9outputs = model(**inputs)
10# model predicts bounding boxes and corresponding face mask detection classes
11logits = outputs.logits
12bboxes = outputs.pred_boxes| Metrics | Metric Parameter | Location | Dets | Value |
|---|---|---|---|---|
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] | 0.273 |
| Average Precision | (AP) @[ IoU=0.50 | area= all | maxDets=100 ] | 0.532 |
| Average Precision | (AP) @[ IoU=0.75 | area= all | maxDets=100 ] | 0.257 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.220 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.341 |
| Average Precision | (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.545 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] | 0.154 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] | 0.361 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] | 0.415 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] | 0.349 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] | 0.469 |
| Average Recall | (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.584 |