Detect particular class #818
Answered
by
fcakyon
Cutinho007
asked this question in
Q&A
-
I have a yolov5 custom trained model, trained with 32 different classes. I tried using SAHI+ yolov5 and it works perfectly. |
Beta Was this translation helpful? Give feedback.
Answered by
fcakyon
Mar 13, 2023
Replies: 2 comments 3 replies
-
Hi, did you run your own model and get .pt? Or just using the pt document sahi provide. |
Beta Was this translation helpful? Give feedback.
3 replies
-
@Cutinho007 this should work: import yolov5
from sahi import AutoDetectionModel
model = yolov5.load('custom_model.pt")
model.classes = [0, 15, 16]
sahi_model = AutoDetectionModel(
model_type='yolov5',
model=model,
)
# use `sahi_model` with `get_prediction` or `get_sliced_prediction` |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fcakyon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Cutinho007 this should work: