Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AccuracyCalculator #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

TepidmishA
Copy link

No description provided.


:param file_path: Путь к файлу с предсказаниями.
"""
self.detections = self._parse_detections(file_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 класса, у каждого 1 статический метод загрузки данных из файла:
GroundtruthReader
DetectionReader

Пример использования:
>>> calc = AccuracyCalculator(iou_threshold=0.5)
>>> calc.load_groundtruths("groundtruths.xlsx")
>>> calc.load_detections("detections.xlsx")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

csv

gts = groundtruths.get(frame_id, []) # Список всех прямоугольников для кадра
tp_det, fp_det, _ = self._match_detections_to_groundtruth(dets, gts)
tp += tp_det
fp += fp_det
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Строки 48-63 и 68-82 дублируют друг друга, поэтому вычисление метрик tp, fp, fn можно вынести в отдельный закрытый метод.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants