Views
No views yet
t3845{}1from huggingface_hub import hf_hub_download
2from libreyolo import LibreYOLO
3
4ckpt = hf_hub_download(repo_id="ander2221/visdrone-yolo9-preview", filename="visdrone.pt")
5model = LibreYOLO(ckpt)
6result = model("aerial.jpg")
7for box, cls, conf in zip(result.boxes.xyxy, result.boxes.cls, result.boxes.conf):
8 print(box, ["pedestrian","people","bicycle","car","van","truck","tricycle","awning-tricycle","bus","motor"][int(cls)], float(conf))1import onnxruntime as ort
2from huggingface_hub import hf_hub_download
3
4onnx = hf_hub_download(repo_id="ander2221/visdrone-yolo9-preview", filename="visdrone.onnx")
5session = ort.InferenceSession(onnx, providers=["CPUExecutionProvider"])
6# Preprocess image to (1, 3, 384, 384) float32 in [0,1] then:
7out = session.run(None, {"images": preprocessed})| idx | name |
|---|---|
| 0 | pedestrian |
| 1 | people |
| 2 | bicycle |
| 3 | car |
| 4 | van |
| 5 | truck |
| 6 | tricycle |
| 7 | awning-tricycle |
| 8 | bus |
| 9 | motor |