Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TODO: Make the color map more sensible.

First generate labels masks with level3Ids as described before. Then
```bash
python evaluate/evaluate_mIoU.py --gts $GT --preds $PRED --num-workers $C
python evaluation/evaluate_mIoU.py --gts $GT --preds $PRED --num-workers $C
```

- GT is the folder path of ground truths containing <drive_no>/<img_no>_gtFine_labellevel3Ids.png
Expand All @@ -107,7 +107,7 @@ python evaluate/evaluate_mIoU.py --gts $GT --preds $PRED --num-workers $C

First generate labels masks with level1Ids as described before. Then
```bash
python evaluate/idd_lite_evaluate_mIoU.py --gts $GT --preds $PRED --num-workers $C
python evaluation/idd_lite_evaluate_mIoU.py --gts $GT --preds $PRED --num-workers $C
```

- GT is the folder path of ground truths containing <drive_no>/<img_no>_gtFine_labellevel1Ids.png
Expand All @@ -120,7 +120,7 @@ python evaluate/idd_lite_evaluate_mIoU.py --gts $GT --preds $PRED --num-worker

First generate instance label masks with ID_TYPE=id, as described before. Then
```bash
python evaluate/evaluate_instance_segmentation.py --gts $GT --preds $PRED
python evaluation/evaluate_instance_segmentation.py --gts $GT --preds $PRED
```

- GT is the folder path of ground truths containing <drive_no>/<img_no>_gtFine_labellevel3Ids.png
Expand All @@ -134,7 +134,7 @@ Please use https://github.com/AutoNUE/panopticapi
### Detection

```bash
python evaluate/evaluate_detection.py --gts $GT --preds $PRED
python evaluation/evaluate_detection.py --gts $GT --preds $PRED
```
- GT is the folder path of ground truths containing Annotations/<capture_category>/<drive sequence>/<>.xml
- PRED is the folder path of predictions with generated outputs in idd_det_<image_set>_<level3Id>.txt format. Here image_set can take {train,val,test}, while level3Id for all trainable labels has to present.
Expand Down
8 changes: 1 addition & 7 deletions evaluation/evaluate_mIoU.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ def add_to_confusion_matrix(gt, pred, mat):
pred = pred.flatten()
gt = gt.flatten()


for (gtp,predp) in zip(gt, pred):
if gtp == 255 or gtp >26 :
gtp = 26
if predp == 255 or predp >26:
predp = 26
mat[gtp, predp] += 1
np.add.at(mat.reshape(-1),mat.shape[1]*gt.copy().clip(max=26).astype(np.uint16)+pred.copy().clip(max=26).astype(np.uint16),1)

return mat

Expand Down
8 changes: 1 addition & 7 deletions evaluation/idd_lite_evaluate_mIoU.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ def add_to_confusion_matrix(gt, pred, mat):
pred = pred.flatten()
gt = gt.flatten()


for (gtp,predp) in zip(gt, pred):
if gtp == 255 or gtp >7 :
gtp = 7
if predp == 255 or predp >7:
predp = 7
mat[gtp, predp] += 1
np.add.at(mat.reshape(-1),mat.shape[1]*gt.copy().clip(max=7).astype(np.uint16)+pred.copy().clip(max=7).astype(np.uint16),1)

return mat

Expand Down