duan8/superpoint/utils.h
Xiang Shin Wuu fdd136466f
SuperPoint TensorRT implementation (#1034)
* adding tensorrt implementation of superpoint network.

* inference output result & todo list added to README
2022-07-06 11:19:10 +08:00

30 lines
982 B
C++

#pragma once
#include <map>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "assert.h"
#include <fstream>
#include <iostream>
#include <memory>
#include <vector>
#include <opencv2/opencv.hpp>
using namespace nvinfer1;
#define CHECK(status) \
do \
{ \
auto ret = (status); \
if (ret != 0) \
{ \
std::cout << "Cuda failure: " << ret; \
abort(); \
} \
} while (0)
int read_files_in_dir(const char *p_dir_name, std::vector<std::string> &file_names);
std::map<std::string, Weights> loadWeights(const std::string file);
void tokenize(const std::string &str, std::vector<std::string> &tokens, const std::string &delimiters = ",");