Skip to content

Commit ad67d21

Browse files
authored
Update README.md
1 parent c3b8e3d commit ad67d21

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# object_detection_confusion_matrix
2-
Python class for calculating confusion matrix for object detection task
2+
3+
The ConfusionMatrix class can be used to generate confusion matrix for the object detection task.
4+
5+
## Usage
6+
7+
In the test code, you need to declare the ConfusionMatrix class with the appropriate parameters.
8+
9+
`conf_mat = ConfusionMatrix(num_classes = 3, CONF_THRESHOLD = 0.3, IOU_THRESHOLD = 0.5)`
10+
11+
The class has a function called, process_batch, you can use it update the confusion matrix.
12+
13+
An example usage can be:
14+
15+
`conf_mat.process_batch(preds, gt_boxes)` where preds are predictions made by model, [N, 6] x1, y1, x2, y2, confidence, class and gt_boxes are the ground truth labels, [M, 4] x1, y1, x2, y2, class.
16+
17+
18+
19+
## References
20+
21+
This repository uses a function from Pytorch repository, https://github.com/pytorch/vision/blob/ae228fef1ce176fa3e3949f5db7b6e87a1e33065/torchvision/ops/boxes.py#L138
22+
23+
and
24+
25+
The code is very similar to the repository below and main contribution of this repository is ConfusionMatrix class can be ued with all deep learning frameworks.
26+
27+
https://github.com/svpino/tf_object_detection_cm
28+

0 commit comments

Comments
 (0)