mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
[Other] Update deprecated segmentation apis && segmentation label map resize interinterpolation (#790)
* Refactor PaddleSeg with preprocessor && postprocessor * Fix bugs * Delete redundancy code * Modify by comments * Refactor according to comments * Add batch evaluation * Add single test script * Add ppliteseg single test script && fix eval(raise) error * fix bug * Fix evaluation segmentation.py batch predict * Fix segmentation evaluation bug * Fix evaluation segmentation bugs * Update segmentation result docs * Update old predict api and DisableNormalizeAndPermute * Update resize segmentation label map with cv::INTER_NEAREST Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -37,7 +37,7 @@ void CpuInfer(const std::string& model_dir, const std::string& image_file) {
|
||||
auto im = cv::imread(image_file);
|
||||
|
||||
fastdeploy::vision::SegmentationResult res;
|
||||
if (!model.Predict(&im, &res)) {
|
||||
if (!model.Predict(im, &res)) {
|
||||
std::cerr << "Failed to predict." << std::endl;
|
||||
return;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ void GpuInfer(const std::string& model_dir, const std::string& image_file) {
|
||||
auto im = cv::imread(image_file);
|
||||
|
||||
fastdeploy::vision::SegmentationResult res;
|
||||
if (!model.Predict(&im, &res)) {
|
||||
if (!model.Predict(im, &res)) {
|
||||
std::cerr << "Failed to predict." << std::endl;
|
||||
return;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void TrtInfer(const std::string& model_dir, const std::string& image_file) {
|
||||
auto im = cv::imread(image_file);
|
||||
|
||||
fastdeploy::vision::SegmentationResult res;
|
||||
if (!model.Predict(&im, &res)) {
|
||||
if (!model.Predict(im, &res)) {
|
||||
std::cerr << "Failed to predict." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ void InitAndInfer(const std::string& model_dir, const std::string& image_file,
|
||||
auto im_bak = im.clone();
|
||||
|
||||
fastdeploy::vision::SegmentationResult res;
|
||||
if (!model.Predict(&im, &res)) {
|
||||
if (!model.Predict(im, &res)) {
|
||||
std::cerr << "Failed to predict." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
@@ -74,12 +74,12 @@ void InferHumanPPHumansegv2Lite(const std::string& device) {
|
||||
auto im = cv::imread(image_file);
|
||||
|
||||
if (device == "npu") {
|
||||
model.DisableNormalizeAndPermute();
|
||||
model.GetPreprocessor().DisableNormalizeAndPermute();
|
||||
}
|
||||
|
||||
fastdeploy::vision::SegmentationResult res;
|
||||
clock_t start = clock();
|
||||
if (!model.Predict(&im, &res)) {
|
||||
if (!model.Predict(im, &res)) {
|
||||
std::cerr << "Failed to predict." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user