This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// ref nv impl | |
/// | |
/// lix19937 | |
/// | |
#include <unistd.h> | |
#include <fstream> | |
#include <vector> | |
#include <cassert> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opencv2/opencv.hpp" | |
void hwc2chw(const cv::Mat &hwc, int h, int w, int c, cv::Mat &chw /* fp32 */) | |
{ | |
std::vector<cv::Mat> channels; | |
cv::split(hwc, channels); | |
int nbytes = h * w; | |
int size4[4] = {1, c, h, w}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <fstream> | |
#include <iomanip> | |
#include <iostream> | |
#include <iterator> | |
#include <map> | |
#include <queue> | |
#include <utility> |