Closed gwxxx closed 2 months ago
I haven't tested it with python but I think so (from my experience, python inference often slower than that of c++). Hope it helps
Thanks for your reply. If I want to use c++ version, how can I save not only depth images but also the original float32 file?
You mean original depth values in float32? Currently, the code only generates a depth image. You need to add a function to write it into raw binary file. Here is an example but didn't test it!
#include <iostream>
#include <fstream>
using namespace std;
// Function to write a float pointer to a binary file
void writeFloatPointerToFile(const float* data, int size, const string& filename) {
ofstream outFile(filename, ios::binary);
if (!outFile) {
cerr << "Unable to open file: " << filename << endl;
return;
}
// Write the data to the file
outFile.write(reinterpret_cast<const char*>(data), sizeof(float) * size);
outFile.close();
}
I haven't tested it with python but I think so (from my experience, python inference often slower than that of c++). Hope it helps