Views
No views yet

ultralytics library with Python. You can then download the weights of this repo and load them into the model.
The image size during training was set to 1792, so be sure to use this too.1from ultralytics import YOLO
2from huggingface_hub import hf_hub_download
3
4# Load the pre-trained model
5model = YOLO(hf_hub_download(
6 repo_id="StephanAkkerman/chart-info-detector",
7 filename="weights/best.pt",
8 repo_type="model",
9))
10
11# Perform object detection on an image
12results = model.predict(
13 source=img_path,
14 imgsz=1792,
15 conf=0.25,
16 iou=0.5,
17 verbose=False,
18)
19
20r = results[0]
21
22# Show the results
23r.show()