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

COCOReader: Support for uncompressed RLE masks #2478

Merged
merged 8 commits into from
Nov 30, 2020
Merged
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
2 changes: 1 addition & 1 deletion DALI_EXTRA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fdd536addddc0f1a5bd52a15db708f95492c813e
355734c4d6f2d3ec77fddf849adac2b812769712
5 changes: 3 additions & 2 deletions dali/operators/reader/coco_reader_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,12 @@ void COCOReader::PixelwiseMasks(int image_idx, int* mask) {
RLE* R;
rlesInit(&R, *labels.rbegin() + 1);

// Create a run-length encoding for each compressed string representation
// Mask was originally described in RLE format
for (uint ann_id = 0 ; ann_id < masks_info.mask_indices.size(); ann_id++) {
const auto &rle = masks_info.rles[ann_id];
auto mask_idx = masks_info.mask_indices[ann_id];
int label = labels_span[mask_idx];
rleFrString(&R[label], const_cast<char*>(masks_info.rles[ann_id].c_str()), h, w);
rleInit(&R[label], rle->h, rle->w, rle->m, rle->cnts);
}

// Merge each label (from multi-polygons annotations)
Expand Down
Loading