Views
No views yet

IoU metric: bbox
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.501
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.866
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.498
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.048
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.455
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.648
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.412
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.601
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.632
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.224
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.600
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.7561from transformers import AutoImageProcessor, AutoModelForObjectDetection
2import torch
3from PIL import Image
4import requests
5
6url = "https://latestbollyholly.com/wp-content/uploads/2024/02/Jacob-Gooch.jpg"
7image = Image.open(requests.get(url, stream=True).raw)
8image_processor = AutoImageProcessor.from_pretrained("AdamCodd/yolos-small-person")
9model = AutoModelForObjectDetection.from_pretrained("AdamCodd/yolos-small-person")
10inputs = image_processor(images=image, return_tensors="pt")
11outputs = model(**inputs)
12
13# convert outputs (bounding boxes and class logits) to Pascal VOC format (xmin, ymin, xmax, ymax)
14target_sizes = torch.tensor([image.size[::-1]])
15results = image_processor.post_process_object_detection(outputs, threshold=0.7, target_sizes=target_sizes)[0]
16for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
17 box = [round(i, 2) for i in box.tolist()]
18 print(
19 f"Detected {model.config.id2label[label.item()]} with confidence "
20 f"{round(score.item(), 3)} at location {box}"
21 )1@article{DBLP:journals/corr/abs-2106-00666,
2 author = {Yuxin Fang and
3 Bencheng Liao and
4 Xinggang Wang and
5 Jiemin Fang and
6 Jiyang Qi and
7 Rui Wu and
8 Jianwei Niu and
9 Wenyu Liu},
10 title = {You Only Look at One Sequence: Rethinking Transformer in Vision through
11 Object Detection},
12 journal = {CoRR},
13 volume = {abs/2106.00666},
14 year = {2021},
15 url = {https://arxiv.org/abs/2106.00666},
16 eprinttype = {arXiv},
17 eprint = {2106.00666},
18 timestamp = {Fri, 29 Apr 2022 19:49:16 +0200},
19 biburl = {https://dblp.org/rec/journals/corr/abs-2106-00666.bib},
20 bibsource = {dblp computer science bibliography, https://dblp.org}
21}