Skip to content

Commit

Permalink
Merge pull request #1160 from OldLipe/feat/dev-sits
Browse files Browse the repository at this point in the history
Fix error in label segmentation
  • Loading branch information
gilbertocamara committed Jun 19, 2024
2 parents 68db70f + 6285e0e commit 908cc9a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/api_label_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,15 @@
return(class_tile)
}
# Get tile labels
labels <- unname(.tile_labels(tile))
tile_labels <- unname(.tile_labels(tile))
# Read probability segments
probs_segments <- .segments_read_vec(tile)
# Segment labels
segment_labels <- setdiff(
colnames(probs_segments), c("supercells", "x", "y", "pol_id", "geom")
)
# Necessary when not all labels are present on the tile
labels <- intersect(tile_labels, segment_labels)
# Classify each segment by majority probability
probs_segments <- probs_segments |>
dplyr::rowwise() |>
Expand Down

0 comments on commit 908cc9a

Please sign in to comment.