Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
deepinfer
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yangxue
deepinfer
Commits
54cfa83e
Commit
54cfa83e
authored
Feb 21, 2023
by
xin.wang.waytous
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in
parent
9ac67037
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
15 additions
and
28 deletions
+15
-28
common.h
include/common/common.h
+9
-4
mobilefacenet_post.h
src/libs/postprocessors/mobilefacenet_post.h
+0
-3
trades_post.h
src/libs/postprocessors/trades_post.h
+0
-3
whenet_post.h
src/libs/postprocessors/whenet_post.h
+0
-3
yolov5_post.h
src/libs/postprocessors/yolov5_post.h
+0
-3
resize_gpu.cu
src/libs/preprocessors/resize_gpu.cu
+3
-2
resize_gpu.h
src/libs/preprocessors/resize_gpu.h
+1
-1
resize_norm.cpp
src/libs/preprocessors/resize_norm.cpp
+2
-2
resize_norm.h
src/libs/preprocessors/resize_norm.h
+0
-4
camera_src.h
src/libs/sources/camera_src.h
+0
-3
No files found.
include/common/common.h
View file @
54cfa83e
...
...
@@ -2,18 +2,21 @@
#define DEEPINFER_COMMON_H_
#include <cublas_v2.h>
#include <cuda_runtime.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <assert.h>
#define BLOCK 512
#define iMAX(a, b) ((a) > (b) ? (a) : (b))
#define iMIN(a, b) ((a) > (b) ? (b) : (a))
// #ifdef USE_CUDA
#include <cublas_v2.h>
#include <cuda_runtime.h>
#define BLOCK 512
#ifndef CUDA_CHECK
#define CUDA_CHECK(callstr) \
{ \
...
...
@@ -24,6 +27,7 @@
} \
}
#endif
// #endif // USE_CUDA
#ifndef PI
#define PI 3.1415926
...
...
@@ -33,6 +37,7 @@ namespace waytous{
namespace
deepinfer
{
namespace
common
{
// #ifdef USE_CUDA
inline
dim3
cudaGridSize
(
uint
n
,
uint
block
)
{
uint
k
=
(
n
-
1
)
/
block
+
1
;
...
...
@@ -46,7 +51,7 @@ inline dim3 cudaGridSize(uint n, uint block)
dim3
d
=
{
x
,
y
,
1
}
;
return
d
;
}
// #endif // USE_CUDA
inline
std
::
string
formatValue
(
float
val
,
int
fixed
)
{
std
::
ostringstream
oss
;
...
...
src/libs/postprocessors/mobilefacenet_post.h
View file @
54cfa83e
...
...
@@ -2,9 +2,6 @@
#ifndef DEEPINFER_POSTPROCESS_MOBILEFACENET_H_
#define DEEPINFER_POSTPROCESS_MOBILEFACENET_H_
#include <cuda_runtime.h>
#include <cstdint>
#include "interfaces/base_unit.h"
#include "base/image.h"
...
...
src/libs/postprocessors/trades_post.h
View file @
54cfa83e
...
...
@@ -2,9 +2,6 @@
#ifndef DEEPINFER_POSTPROCESS_TRDES_H_
#define DEEPINFER_POSTPROCESS_TRDES_H_
#include <cuda_runtime.h>
#include <cstdint>
#include "interfaces/base_unit.h"
#include "base/image.h"
...
...
src/libs/postprocessors/whenet_post.h
View file @
54cfa83e
...
...
@@ -2,9 +2,6 @@
#ifndef DEEPINFER_POSTPROCESS_WHENet_H_
#define DEEPINFER_POSTPROCESS_WHENet_H_
#include <cuda_runtime.h>
#include <cstdint>
#include "interfaces/base_unit.h"
#include "base/image.h"
...
...
src/libs/postprocessors/yolov5_post.h
View file @
54cfa83e
...
...
@@ -2,9 +2,6 @@
#ifndef DEEPINFER_POSTPROCESS_YOLOV5_H_
#define DEEPINFER_POSTPROCESS_YOLOV5_H_
#include <cuda_runtime.h>
#include <cstdint>
#include "interfaces/base_unit.h"
#include "base/image.h"
...
...
src/libs/preprocessors/resize_gpu.cu
View file @
54cfa83e
...
...
@@ -96,7 +96,8 @@ __global__ void warpaffine_kernel(
void resizeGPU(uint8_t* src, int src_width, int src_height, int step_width,
float* dst, int dst_width, int dst_height, float* input_mean, float* input_std,
bool bgr, bool resizeFixAspectRatio, cudaStream_t stream){
bool bgr, bool resizeFixAspectRatio)
{
AffineMatrix s2d, d2s;
float scalex = dst_width / (float)src_width;
float scaley = dst_height / (float)src_height;
...
...
@@ -121,7 +122,7 @@ void resizeGPU(uint8_t* src, int src_width, int src_height, int step_width,
int jobs = dst_height * dst_width;
int threads = 256;
int blocks = ceil(jobs / (float)threads);
warpaffine_kernel<<<blocks, threads, 0
, stream>>>(
warpaffine_kernel<<<blocks, threads, 0
>>>( //, stream
src, step_width, src_width,
src_height, dst, dst_width,
dst_height, 128, d2s, jobs, input_mean, input_std, bgr);
...
...
src/libs/preprocessors/resize_gpu.h
View file @
54cfa83e
...
...
@@ -18,7 +18,7 @@ struct AffineMatrix{
void
resizeGPU
(
uint8_t
*
src
,
int
src_width
,
int
src_height
,
int
step_width
,
float
*
dst
,
int
dst_width
,
int
dst_height
,
float
*
input_mean
,
float
*
input_std
,
bool
bgr
,
bool
resizeFixAspectRatio
,
cudaStream_t
stream
);
bool
bgr
,
bool
resizeFixAspectRatio
);
}
//namespace preprocess
...
...
src/libs/preprocessors/resize_norm.cpp
View file @
54cfa83e
...
...
@@ -7,7 +7,7 @@ namespace preprocess {
bool
ResizeNorm
::
Init
(
YAML
::
Node
&
node
){
CUDA_CHECK
(
cudaStreamCreate
(
&
stream_
));
//
CUDA_CHECK(cudaStreamCreate(&stream_));
if
(
!
BaseUnit
::
Init
(
node
)){
LOG_WARN
<<
"Init resize_norm error"
;
return
false
;
...
...
@@ -56,7 +56,7 @@ bool ResizeNorm::Exec(){
inputWidth
,
inputHeight
,
mean
->
mutable_gpu_data
(),
std
->
mutable_gpu_data
(),
useBGR
,
fixAspectRatio
,
stream_
useBGR
,
fixAspectRatio
);
}
// ios::NormalIOPtr dst_ptr = std::make_shared<ios::NormalIO>(ios::NormalIO(dst));
...
...
src/libs/preprocessors/resize_norm.h
View file @
54cfa83e
#ifndef DEEPINFER_PREPROCESS_RESIZE_NORM_H_
#define DEEPINFER_PREPROCESS_RESIZE_NORM_H_
#include <cuda_runtime.h>
#include <cstdint>
#include "interfaces/base_unit.h"
#include "base/image.h"
...
...
@@ -33,7 +30,6 @@ public:
bool
fixAspectRatio
=
true
;
bool
useBGR
=
false
;
base
::
BlobPtr
<
float
>
dst
,
mean
,
std
;
cudaStream_t
stream_
;
};
...
...
src/libs/sources/camera_src.h
View file @
54cfa83e
#ifndef DEEPINFER_CAMERA_SOURCE_H_
#define DEEPINFER_CAMERA_SOURCE_H_
#include <cuda_runtime.h>
#include <cstdint>
#include "base/image.h"
#include "interfaces/base_unit.h"
#include "libs/ios/camera_ios.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment