Skip to content

Commit ff496e5

Browse files
author
Louis Fréneau
committed
Bug fix intermediate file export
1 parent e4fcd51 commit ff496e5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/lib/mapGeneration/mapGeneration.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,9 @@ void MapGenerationBaseLine::generateFrameMaps(const std::shared_ptr<uvgvpcc_enc:
556556

557557
// Geometry and attribute map generation //
558558
writePatches(frame, frame->mapHeight);
559-
std::vector<Vector3<uint8_t>>().swap(frame->pointsAttribute); // Release memory
559+
if(!p_->exportIntermediateMaps) {
560+
std::vector<Vector3<uint8_t>>().swap(frame->pointsAttribute); // Release memory
561+
}
560562

561563
// Background filling //
562564
fillBackgroundImages(frame, frame->mapHeight);
@@ -568,6 +570,7 @@ void MapGenerationBaseLine::generateFrameMaps(const std::shared_ptr<uvgvpcc_enc:
568570

569571
if (p_->exportIntermediateMaps /*|| p_->useEncoderCommand*/) {
570572
writeFrameMapsYUV(frame);
573+
std::vector<Vector3<uint8_t>>().swap(frame->pointsAttribute); // Release memory
571574
}
572575
}
573576

src/lib/patchGeneration/patchSegmentation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,6 @@ void PatchSegmentation::patchSegmentation(const std::shared_ptr<uvgvpcc_enc::Fra
713713
refillRawPoints(resamplePointSet, rawPoints, frame->pointsGeometry, pointCount, flags, nnPropagationMapFlagTrue);
714714
}
715715

716-
std::vector<size_t>().swap(frame->patchPartition); // Release memory
717-
718-
719716
if (p_->exportIntermediatePointClouds) {
720717
const std::string plyFilePath =
721718
p_->intermediateFilesDir + "/patchSegmentation/PATCH-SEGMENTATION_f-" + uvgvpcc_enc::zeroPad(frame->frameId, 3) + ".ply";
@@ -728,4 +725,6 @@ void PatchSegmentation::patchSegmentation(const std::shared_ptr<uvgvpcc_enc::Fra
728725
}
729726
exportPointCloud(plyFilePath, frame->pointsGeometry, attributes);
730727
}
728+
729+
std::vector<size_t>().swap(frame->patchPartition); // Release memory
731730
}

0 commit comments

Comments
 (0)