12 lines
387 B
Python
12 lines
387 B
Python
from sahi import AutoDetectionModel
|
|
from sahi.predict import get_prediction, get_sliced_prediction
|
|
ckpt_path = "yolov8l.pt"
|
|
|
|
detection_model = AutoDetectionModel.from_pretrained(
|
|
model_type='yolov8',
|
|
model_path=ckpt_path,
|
|
confidence_threshold=0.25, ## same as the default value for our base model
|
|
image_size=640,
|
|
device="cpu", # or 'cuda' if you have access to GPU
|
|
)
|