Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
7bcea8d0
"git@developer.sourcefind.cn:chenpangpang/diffusers.git" did not exist on "c4d66200b7a747a3657e81c188a5d833f23a7d47"
Unverified
Commit
7bcea8d0
authored
Jun 22, 2021
by
littletomatodonkey
Committed by
GitHub
Jun 22, 2021
Browse files
fix normalize (#3147)
parent
028ccc45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
deploy/cpp_infer/src/preprocess_op.cpp
deploy/cpp_infer/src/preprocess_op.cpp
+6
-9
No files found.
deploy/cpp_infer/src/preprocess_op.cpp
View file @
7bcea8d0
...
@@ -47,16 +47,13 @@ void Normalize::Run(cv::Mat *im, const std::vector<float> &mean,
...
@@ -47,16 +47,13 @@ void Normalize::Run(cv::Mat *im, const std::vector<float> &mean,
e
/=
255.0
;
e
/=
255.0
;
}
}
(
*
im
).
convertTo
(
*
im
,
CV_32FC3
,
e
);
(
*
im
).
convertTo
(
*
im
,
CV_32FC3
,
e
);
for
(
int
h
=
0
;
h
<
im
->
rows
;
h
++
)
{
std
::
vector
<
cv
::
Mat
>
bgr_channels
(
3
);
for
(
int
w
=
0
;
w
<
im
->
cols
;
w
++
)
{
cv
::
split
(
*
im
,
bgr_channels
);
im
->
at
<
cv
::
Vec3f
>
(
h
,
w
)[
0
]
=
for
(
auto
i
=
0
;
i
<
bgr_channels
.
size
();
i
++
)
{
(
im
->
at
<
cv
::
Vec3f
>
(
h
,
w
)[
0
]
-
mean
[
0
])
*
scale
[
0
];
bgr_channels
[
i
].
convertTo
(
bgr_channels
[
i
],
CV_32FC1
,
1.0
*
scale
[
i
],
im
->
at
<
cv
::
Vec3f
>
(
h
,
w
)[
1
]
=
(
0.0
-
mean
[
i
])
*
scale
[
i
]);
(
im
->
at
<
cv
::
Vec3f
>
(
h
,
w
)[
1
]
-
mean
[
1
])
*
scale
[
1
];
im
->
at
<
cv
::
Vec3f
>
(
h
,
w
)[
2
]
=
(
im
->
at
<
cv
::
Vec3f
>
(
h
,
w
)[
2
]
-
mean
[
2
])
*
scale
[
2
];
}
}
}
cv
::
merge
(
bgr_channels
,
*
im
);
}
}
void
ResizeImgType0
::
Run
(
const
cv
::
Mat
&
img
,
cv
::
Mat
&
resize_img
,
void
ResizeImgType0
::
Run
(
const
cv
::
Mat
&
img
,
cv
::
Mat
&
resize_img
,
...
...
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