Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayshuo committed Oct 22, 2024
1 parent ad34101 commit 1667ad4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion yolov8/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else()

# tensorrt
include_directories(/home/lindsay/TensorRT-8.6.1.6/include)
link_directories(/home/lindsay/TensorRT-6.1.6/lib)
link_directories(/home/lindsay/TensorRT-8.6.1.6/lib)
# include_directories(/home/lindsay/TensorRT-7.2.3.4/include)
# link_directories(/home/lindsay/TensorRT-7.2.3.4/lib)

Expand Down
2 changes: 1 addition & 1 deletion yolov8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ sudo ./yolov8_cls -d yolov8n-cls.engine ../samples
### Pose Estimation
```
cd {tensorrtx}/yolov8/
// update "kPOseNumClass = 1" in config.h
// update "kPoseNumClass = 1" in config.h
mkdir build
cd build
cp {ultralytics}/ultralytics/yolov8-pose.wts {tensorrtx}/yolov8/build
Expand Down
2 changes: 1 addition & 1 deletion yolov8/include/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ nvinfer1::IShuffleLayer* DFL(nvinfer1::INetworkDefinition* network, std::map<std

nvinfer1::IPluginV2Layer* addYoLoLayer(nvinfer1::INetworkDefinition* network,
std::vector<nvinfer1::IConcatenationLayer*> dets, const int* px_arry,
int px_arry_num, int NumClass, bool is_segmentation, bool is_pose, bool is_obb);
int px_arry_num, int num_class, bool is_segmentation, bool is_pose, bool is_obb);
2 changes: 1 addition & 1 deletion yolov8/include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ constexpr static int kClsInputH = 224;
constexpr static int kClsInputW = 224;

// pose model's number of classes
constexpr static int kPOseNumClass = 1;
constexpr static int kPoseNumClass = 1;
const static int kNumberOfPoints = 17; // number of keypoints total

// obb model's number of classes
Expand Down
2 changes: 1 addition & 1 deletion yolov8/plugin/yololayer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ __global__ void CalDetection(const float* input, float* output, int numElements,
}

if (is_obb) {
double pi = 3.141592653589793f;
double pi = M_PI;
auto angle_inx = curInput[elemIdx + (4 + classes + (is_segmentation ? 32 : 0) + (is_pose ? N_kpts * 3 : 0) +
0) * total_grid];
auto angle = (sigmoid(angle_inx) - 0.25f) * pi;
Expand Down
5 changes: 3 additions & 2 deletions yolov8/src/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,15 @@ nvinfer1::IShuffleLayer* DFL(nvinfer1::INetworkDefinition* network, std::map<std

nvinfer1::IPluginV2Layer* addYoLoLayer(nvinfer1::INetworkDefinition* network,
std::vector<nvinfer1::IConcatenationLayer*> dets, const int* px_arry,
int px_arry_num, int NumClass, bool is_segmentation, bool is_pose, bool is_obb) {
int px_arry_num, int num_class, bool is_segmentation, bool is_pose,
bool is_obb) {
auto creator = getPluginRegistry()->getPluginCreator("YoloLayer_TRT", "1");
const int netinfo_count = 9; // Assuming the first 5 elements are for netinfo as per existing code.
const int total_count = netinfo_count + px_arry_num; // Total number of elements for netinfo and px_arry combined.

std::vector<int> combinedInfo(total_count);
// Fill in the first 5 elements as per existing netinfo.
combinedInfo[0] = NumClass;
combinedInfo[0] = num_class;
combinedInfo[1] = kNumberOfPoints;
combinedInfo[2] = kConfThreshKeypoints;
combinedInfo[3] = kInputW;
Expand Down
50 changes: 25 additions & 25 deletions yolov8/src/model.cpp

Large diffs are not rendered by default.

0 comments on commit 1667ad4

Please sign in to comment.