Skip to content

Commit

Permalink
Merge pull request #1 from DARPA-CRITICALMAAS/bugfix/dim-broadcast
Browse files Browse the repository at this point in the history
Unrolling brocast
  • Loading branch information
abodeuis authored May 28, 2024
2 parents 470b199 + 35ac205 commit ef7a06b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ Example of a validation image from a UIUC model run on AR_StJoe_Mbs_poly
Flag to enable the saving of debugging feedback images.

## Authors and acknowledgment
This repo was created by and is maintained by the UIUC team.
This repo was created by and is maintained by the amazing UIUC team.
17 changes: 12 additions & 5 deletions src/grading.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ def grade_poly_raster(pred_image, true_image, feedback_image=None):
return (0, 0, 0, 0, feedback_image)

if feedback_image is not None:
feedback_image[(true_image>=1).all(-1)] = MISS_COLOR
feedback_image[(pred_image>=1).all(-1)] = FAIL_COLOR
feedback_image[(intersection==1).all(-1)] = CORRECT_COLOR

feedback_image[0][(true_image>=1)[0]] = MISS_COLOR[0]
feedback_image[1][(true_image>=1)[0]] = MISS_COLOR[1]
feedback_image[2][(true_image>=1)[0]] = MISS_COLOR[2]
feedback_image[0][(pred_image>=1)[0]] = FAIL_COLOR[0]
feedback_image[1][(pred_image>=1)[0]] = FAIL_COLOR[1]
feedback_image[2][(pred_image>=1)[0]] = FAIL_COLOR[2]
feedback_image[0][(intersection==1)[0]] = CORRECT_COLOR[0]
feedback_image[1][(intersection==1)[0]] = CORRECT_COLOR[1]
feedback_image[2][(intersection==1)[0]] = CORRECT_COLOR[2]

#raise Exception(f"feedback Dim {type((true_image>=1))}\n{(true_image>=1).shape}\n {type(feedback_image)} \n{feedback_image[0].shape}")
recall = true_positive / np.count_nonzero(true_image)
precision = true_positive / np.count_nonzero(pred_image)

Expand Down Expand Up @@ -230,4 +237,4 @@ def detect_difficult_pixels(map_image, true_image, lgd_pts, set_false_as='hard')
# the outside pixels will be deemed easy!
hard_pixel_mask=pred_by_color

return hard_pixel_mask
return hard_pixel_mask

0 comments on commit ef7a06b

Please sign in to comment.