mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Android] Support segmentation and facedet in Android (#567)
* [FlyCV] Add global SetProcLibCpuNumThreads method * [Android] Support segmentation and facedet in Android * [Android] add JNI instance check to j_runtime_option_obj * [Model] fixed ppseg flycv resize error * [FlyCV] fix FlyCV resize flags * [cmake] remove un-need lite compile option * [Android] add PaddleSegModel JNI and fix some bugs * [Android] bind PaddleSegModel via JNI * [Android] bind VisSegmentation via JNI * [Android] bind YOLOv5Face and SCRFD via JNI * [Android] fix NewJavaFaceDetectionResultFromCxx error
This commit is contained in:
@@ -114,7 +114,7 @@ bool ScaledYOLOv4::Preprocess(
|
||||
// process after image load
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -112,7 +112,7 @@ bool YOLOR::Preprocess(Mat* mat, FDTensor* output,
|
||||
// process after image load
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -145,7 +145,7 @@ bool YOLOv5::Preprocess(Mat* mat, FDTensor* output,
|
||||
// process after image load
|
||||
double ratio = (size[0] * 1.0) / std::max(static_cast<float>(mat->Height()),
|
||||
static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -164,7 +164,7 @@ bool YOLOv5Lite::Preprocess(
|
||||
// process after image load
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -136,7 +136,7 @@ bool YOLOv6::Preprocess(Mat* mat, FDTensor* output,
|
||||
// process after image load
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -134,7 +134,7 @@ bool YOLOv7::Preprocess(Mat* mat, FDTensor* output,
|
||||
// process after image load
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -115,7 +115,7 @@ bool YOLOv7End2EndORT::Preprocess(
|
||||
std::map<std::string, std::array<float, 2>>* im_info) {
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
@@ -146,7 +146,7 @@ bool YOLOv7End2EndTRT::Preprocess(
|
||||
std::map<std::string, std::array<float, 2>>* im_info) {
|
||||
float ratio = std::min(size[1] * 1.0f / static_cast<float>(mat->Height()),
|
||||
size[0] * 1.0f / static_cast<float>(mat->Width()));
|
||||
if (ratio != 1.0) {
|
||||
if (std::fabs(ratio - 1.0f) > 1e-06) {
|
||||
int interp = cv::INTER_AREA;
|
||||
if (ratio > 1.0) {
|
||||
interp = cv::INTER_LINEAR;
|
||||
|
Reference in New Issue
Block a user