-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to main branch from tensorrtx
- Loading branch information
1 parent
6ec8460
commit 1e004ac
Showing
19 changed files
with
2,187 additions
and
564 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
#pragma once | ||
#include <map> | ||
#include <vector> | ||
#include <string> | ||
#include <vector> | ||
#include "NvInfer.h" | ||
|
||
std::map<std::string, nvinfer1::Weights> loadWeights(const std::string file); | ||
|
||
nvinfer1::IElementWiseLayer* convBnSiLU(nvinfer1::INetworkDefinition* network, std::map<std::string, nvinfer1::Weights> weightMap, | ||
nvinfer1::ITensor& input, int ch, int k, int s, int p, std::string lname); | ||
|
||
nvinfer1::IElementWiseLayer* C2F(nvinfer1::INetworkDefinition* network, std::map<std::string, nvinfer1::Weights> weightMap, | ||
nvinfer1::ITensor& input, int c1, int c2, int n, bool shortcut, float e, std::string lname); | ||
nvinfer1::IElementWiseLayer* convBnSiLU(nvinfer1::INetworkDefinition* network, | ||
std::map<std::string, nvinfer1::Weights> weightMap, nvinfer1::ITensor& input, | ||
int ch, int k, int s, int p, std::string lname); | ||
|
||
nvinfer1::IElementWiseLayer* C2(nvinfer1::INetworkDefinition* network, std::map<std::string, nvinfer1::Weights>& weightMap, | ||
nvinfer1::ITensor& input, int c1, int c2, int n, bool shortcut, float e, std::string lname); | ||
nvinfer1::IElementWiseLayer* C2F(nvinfer1::INetworkDefinition* network, | ||
std::map<std::string, nvinfer1::Weights> weightMap, nvinfer1::ITensor& input, int c1, | ||
int c2, int n, bool shortcut, float e, std::string lname); | ||
|
||
nvinfer1::IElementWiseLayer* SPPF(nvinfer1::INetworkDefinition* network, std::map<std::string, nvinfer1::Weights> weightMap, | ||
nvinfer1::ITensor& input, int c1, int c2, int k, std::string lname); | ||
nvinfer1::IElementWiseLayer* C2(nvinfer1::INetworkDefinition* network, | ||
std::map<std::string, nvinfer1::Weights>& weightMap, nvinfer1::ITensor& input, int c1, | ||
int c2, int n, bool shortcut, float e, std::string lname); | ||
|
||
nvinfer1::IShuffleLayer* DFL(nvinfer1::INetworkDefinition* network, std::map<std::string, nvinfer1::Weights> weightMap, | ||
nvinfer1::ITensor& input, int ch, int grid, int k, int s, int p, std::string lname); | ||
nvinfer1::IElementWiseLayer* SPPF(nvinfer1::INetworkDefinition* network, | ||
std::map<std::string, nvinfer1::Weights> weightMap, nvinfer1::ITensor& input, int c1, | ||
int c2, int k, std::string lname); | ||
|
||
nvinfer1::IPluginV2Layer* addYoLoLayer(nvinfer1::INetworkDefinition* network, std::vector<nvinfer1::IConcatenationLayer*> dets, const int* px_arry, int px_arry_num, bool is_segmentation); | ||
nvinfer1::IShuffleLayer* DFL(nvinfer1::INetworkDefinition* network, std::map<std::string, nvinfer1::Weights> weightMap, | ||
nvinfer1::ITensor& input, int ch, int grid, int k, int s, int p, std::string lname); | ||
|
||
nvinfer1::IPluginV2Layer* addYoLoLayer(nvinfer1::INetworkDefinition* network, | ||
std::vector<nvinfer1::IConcatenationLayer*> dets, const int* px_arry, | ||
int px_arry_num, bool is_segmentation, bool is_pose); |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
#include "NvInfer.h" | ||
#include <opencv2/opencv.hpp> | ||
#include "NvInfer.h" | ||
#include "types.h" | ||
|
||
cv::Rect get_rect(cv::Mat& img, float bbox[4]); | ||
|
||
void nms(std::vector<Detection>& res, float *output, float conf_thresh, float nms_thresh = 0.5); | ||
void nms(std::vector<Detection>& res, float* output, float conf_thresh, float nms_thresh = 0.5); | ||
|
||
void batch_nms(std::vector<std::vector<Detection>>& batch_res, float* output, int batch_size, int output_size, | ||
float conf_thresh, float nms_thresh = 0.5); | ||
|
||
void batch_nms(std::vector<std::vector<Detection>>& batch_res, float *output, int batch_size, int output_size, float conf_thresh, float nms_thresh = 0.5); | ||
void draw_bbox(std::vector<cv::Mat>& img_batch, std::vector<std::vector<Detection>>& res_batch); | ||
|
||
void draw_bbox(std::vector<cv::Mat> &img_batch, std::vector<std::vector<Detection>> &res_batch); | ||
void draw_bbox_keypoints_line(std::vector<cv::Mat>& img_batch, std::vector<std::vector<Detection>>& res_batch); | ||
|
||
void batch_process(std::vector<std::vector<Detection>> &res_batch, const float* decode_ptr_host, int batch_size, int bbox_element, const std::vector<cv::Mat>& img_batch); | ||
void batch_process(std::vector<std::vector<Detection>>& res_batch, const float* decode_ptr_host, int batch_size, | ||
int bbox_element, const std::vector<cv::Mat>& img_batch); | ||
|
||
void process_decode_ptr_host(std::vector<Detection> &res, const float* decode_ptr_host, int bbox_element, cv::Mat& img, int count); | ||
void process_decode_ptr_host(std::vector<Detection>& res, const float* decode_ptr_host, int bbox_element, cv::Mat& img, | ||
int count); | ||
|
||
void cuda_decode(float* predict, int num_bboxes, float confidence_threshold,float* parray,int max_objects, cudaStream_t stream); | ||
void cuda_decode(float* predict, int num_bboxes, float confidence_threshold, float* parray, int max_objects, | ||
cudaStream_t stream); | ||
|
||
void cuda_nms(float* parray, float nms_threshold, int max_objects, cudaStream_t stream); | ||
|
||
void draw_mask_bbox(cv::Mat& img, std::vector<Detection>& dets, std::vector<cv::Mat>& masks, std::unordered_map<int, std::string>& labels_map); | ||
void draw_mask_bbox(cv::Mat& img, std::vector<Detection>& dets, std::vector<cv::Mat>& masks, | ||
std::unordered_map<int, std::string>& labels_map); |
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
Oops, something went wrong.