Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mpj1234 committed Jul 16, 2024
1 parent fdfbefd commit ca507e8
Show file tree
Hide file tree
Showing 17 changed files with 1,137 additions and 1,276 deletions.
30 changes: 15 additions & 15 deletions yolov8/yolov8_trt10/include/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@

std::map<std::string, nvinfer1::Weights> loadWeights(const std::string file);

nvinfer1::IScaleLayer *addBatchNorm2d(nvinfer1::INetworkDefinition *network,
std::map<std::string, nvinfer1::Weights> weightMap,
nvinfer1::ITensor &input, std::string lname, float eps);
nvinfer1::IScaleLayer* addBatchNorm2d(nvinfer1::INetworkDefinition* network,
std::map<std::string, nvinfer1::Weights> weightMap, nvinfer1::ITensor& input,
std::string lname, float eps);

nvinfer1::IElementWiseLayer *convBnSiLU(nvinfer1::INetworkDefinition *network,
std::map<std::string, nvinfer1::Weights> weightMap, nvinfer1::ITensor &input,
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,
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 *C2(nvinfer1::INetworkDefinition *network,
std::map<std::string, nvinfer1::Weights> &weightMap, nvinfer1::ITensor &input, int c1,
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 *SPPF(nvinfer1::INetworkDefinition *network,
std::map<std::string, nvinfer1::Weights> weightMap, nvinfer1::ITensor &input, int c1,
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::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::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,
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);
12 changes: 6 additions & 6 deletions yolov8/yolov8_trt10/include/calibrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
//! \brief Implements Entropy calibrator 2.
//! CalibrationAlgoType is kENTROPY_CALIBRATION_2.
//!
class Int8EntropyCalibrator2 : public nvinfer1::IInt8EntropyCalibrator2
{
public:
Int8EntropyCalibrator2(int batchsize, int input_w, int input_h, const char* img_dir, const char* calib_table_name, const char* input_blob_name, bool read_cache = true);
class Int8EntropyCalibrator2 : public nvinfer1::IInt8EntropyCalibrator2 {
public:
Int8EntropyCalibrator2(int batchsize, int input_w, int input_h, const char* img_dir, const char* calib_table_name,
const char* input_blob_name, bool read_cache = true);
virtual ~Int8EntropyCalibrator2();
int getBatchSize() const TRT_NOEXCEPT override;
bool getBatch(void* bindings[], const char* names[], int nbBindings) TRT_NOEXCEPT override;
const void* readCalibrationCache(size_t& length) TRT_NOEXCEPT override;
void writeCalibrationCache(const void* cache, size_t length) TRT_NOEXCEPT override;

private:
private:
int batchsize_;
int input_w_;
int input_h_;
Expand All @@ -36,4 +36,4 @@ class Int8EntropyCalibrator2 : public nvinfer1::IInt8EntropyCalibrator2
std::vector<char> calib_cache_;
};

#endif // ENTROPY_CALIBRATOR_H
#endif // ENTROPY_CALIBRATOR_H
2 changes: 1 addition & 1 deletion yolov8/yolov8_trt10/include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const static char* kInputTensorName = "images";
const static char* kOutputTensorName = "output";
const static char *kProtoTensorName = "proto";
const static char* kProtoTensorName = "proto";
const static int kNumClass = 80;
const static int kPoseNumClass = 1;
const static int kNumberOfPoints = 17; // number of keypoints total
Expand Down
15 changes: 7 additions & 8 deletions yolov8/yolov8_trt10/include/cuda_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
#include <cuda_runtime_api.h>

#ifndef CUDA_CHECK
#define CUDA_CHECK(callstr)\
{\
cudaError_t error_code = callstr;\
if (error_code != cudaSuccess) {\
std::cerr << "CUDA error " << error_code << " at " << __FILE__ << ":" << __LINE__;\
assert(0);\
}\
#define CUDA_CHECK(callstr) \
{ \
cudaError_t error_code = callstr; \
if (error_code != cudaSuccess) { \
std::cerr << "CUDA error " << error_code << " at " << __FILE__ << ":" << __LINE__; \
assert(0); \
} \
}
#endif // CUDA_CHECK

#endif // TRTX_CUDA_UTILS_H_

Loading

0 comments on commit ca507e8

Please sign in to comment.