deel-ai / oodeel

Simple, compact, and hackable post-hoc deep OOD detection for already trained tensorflow or pytorch image classifiers.
https://deel-ai.github.io/oodeel/
MIT License
52 stars 2 forks source link

Squeeze labels in fit_to_dataset function for Mahalanobis #54

Closed cofri closed 1 year ago

cofri commented 1 year ago

When retrieving the labels in Mahalanobis function fit_to_dataset, the labels must be in shape (batch_size,). However when labels are in shape (batch_size, 1), which can occur with some binary classification datasets, an error was raised because of incompatible shapes.

This PR fixes the issue: the labels are now squeezed to ensure that labels are of shape (batch_size,).

github-actions[bot] commented 1 year ago

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1615 1454 90% 70% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
oodeel/methods/mahalanobis.py 95% 🟢
TOTAL 95% 🟢

updated for commit: e9a7ad1 by action🐍