Hi aleksajanjic99
I'm just curious have you solved this problem? I am also using YOLOV5s classification model to do my work, and finding the classified results are just way worse than what I got by running the trained model on host (which means I didn't run my model on OAK-D camera). Cannot really figure this out.
Also I'd like to know your thoughts Jaka jakaskerl. In another person's post I asked a related question, and Matija thought it could be that I used an improper way to retrieve classified results from the last layer of my model (like I shouldn't use softmax to get my classifications). I am a bit confused because all the classification examples I could find online are using a softmax to get their results finally. In addition, I don't understand how do my inaccurate results have anything to do with softmax…
To verify that my model can work well but just something wrong with configuration on OAK, I ran my classification model on my host, and it happened to be good. A part of my code is like below:
# Inference with YOLOv5
with torch.no_grad():
results = model(img_tensor)
# Convert the logits to percentages using softmax
probs = F.softmax(results, dim=1)
# Get class with highest confidence
confidences, class_idx = probs.squeeze(0).max(0)
label = f'{class_names[class_idx]} {confidences:.2f}'
Glad to know your thoughts on this problem.
Cheers,
Austin