Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -817,14 +817,6 @@ gxf_result_t FoundationposeSampling::tick() noexcept {
m.block<3, 1>(0, 3) = center;
}

// Flatten vector of eigen matrix into vector to make the memory continuous
std::vector<float> ob_in_cams_vector;
ob_in_cams_vector.reserve(ob_in_cams.size() * ob_in_cams[0].size());
for (auto& mat : ob_in_cams) {
std::vector<float> mat_data(mat.data(), mat.data() + mat.size());
ob_in_cams_vector.insert(ob_in_cams_vector.end(), mat_data.begin(), mat_data.end());
}

// Add padding to the last batch to make the size divisible by kNumBatches
auto remainder = ob_in_cams.size() % kNumBatches;
auto padding_size = remainder == 0 ? 0 : kNumBatches - remainder;
Expand All @@ -838,6 +830,14 @@ gxf_result_t FoundationposeSampling::tick() noexcept {
}
}

// Flatten vector of eigen matrix into vector to make the memory continuous
std::vector<float> ob_in_cams_vector;
ob_in_cams_vector.reserve(ob_in_cams.size() * ob_in_cams[0].size());
for (auto& mat : ob_in_cams) {
std::vector<float> mat_data(mat.data(), mat.data() + mat.size());
ob_in_cams_vector.insert(ob_in_cams_vector.end(), mat_data.begin(), mat_data.end());
}

int batch_size = ob_in_cams.size() / kNumBatches;
for (int i = 0; i < kNumBatches; i++) {
// Allocate output message
Expand Down