提交 3ba282b4 编写于 作者: B BohaoWu

Add pre-commit.

上级 a832f4bf
......@@ -35,7 +35,8 @@ std::shared_ptr<OpContext> Resize::operator()(
percent = static_cast<float>(_max_size) / static_cast<float>(im_max_size);
}
resized_width = static_cast<int>(round(input->nppi_size().width * percent));
resized_height = static_cast<int>(round(input->nppi_size().height * percent));
resized_height =
static_cast<int>(round(input->nppi_size().height * percent));
}
auto output = std::make_shared<OpContext>(resized_height, resized_width);
auto ret = resize_linear(input->p_frame(),
......
......@@ -14,8 +14,8 @@
#include <npp.h>
#include "core/preprocess/hwvideoframe/include/utils.h"
#include "core/preprocess/hwvideoframe/include/rgb_swap.h"
#include "core/preprocess/hwvideoframe/include/utils.h"
const int SwapChannel::_ORDER[CHANNEL_SIZE] = {2, 1, 0};
......
......@@ -82,7 +82,7 @@ class ExtractFrameJpeg : public ExtractFrameBase {
int jpeg_encode(uint8_t* p_image,
int width,
int height,
FrameResult &result);
const FrameResult& result);
nvjpegHandle_t _nv_jpeg_handler;
nvjpegEncoderState_t _nv_enc_state;
nvjpegEncoderParams_t _nv_enc_params;
......
......@@ -21,6 +21,7 @@ from paddle_serving_app.reader import Sequential, Resize, File2Image
import libgpupreprocess as pp
import libhwextract
class TestOperators(unittest.TestCase):
"""
test all operators, e.g. Div, Normalize
......@@ -172,5 +173,6 @@ class TestOperators(unittest.TestCase):
item.free_memory()
# have to release memor
if __name__ == '__main__':
unittest.main()
......@@ -11,5 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=doc-string-missing
from .arr2image import Arr2Image
\ No newline at end of file
from .arr2image import Arr2Image
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册