Skip to content

Commit

Permalink
Fix visualization and correct default model (opencv#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan1288 authored Feb 29, 2024
1 parent 488fb8e commit 80ef421
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions models/text_detection_ppocr/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vector< pair<cv::dnn::Backend, cv::dnn::Target> > backendTargetPairs = {

std::string keys =
"{ help h | | Print help message. }"
"{ model m | text_detection_ch_ppocrv3_2023may.onnx | Usage: Set model type, defaults to text_detection_ch_ppocrv3_2023may.onnx }"
"{ model m | text_detection_cn_ppocrv3_2023may.onnx | Usage: Set model type, defaults to text_detection_ch_ppocrv3_2023may.onnx }"
"{ input i | | Usage: Path to input image or video file. Skip this argument to capture frames from a camera.}"
"{ width | 736 | Usage: Resize input image to certain width, default = 736. It should be multiple by 32.}"
"{ height | 736 | Usage: Resize input image to certain height, default = 736. It should be multiple by 32.}"
Expand Down Expand Up @@ -113,7 +113,7 @@ int main(int argc, char** argv)
int maxCand = parser.get<int>("max_candidates");
double unRatio = parser.get<float>("unclip_ratio");
bool save = parser.get<bool>("save");
bool viz = parser.get<float>("viz");
bool viz = parser.get<bool>("viz");

PPOCRDet model(modelName, inpSize, binThresh, polyThresh, maxCand, unRatio, backendTargetPairs[backendTargetid].first, backendTargetPairs[backendTargetid].second);

Expand Down Expand Up @@ -172,7 +172,10 @@ int main(int argc, char** argv)
imwrite("result.jpg", originalImage);
}
if (viz)
{
imshow(kWinName, originalImage);
waitKey(0);
}
}
else
imshow(kWinName, originalImage);
Expand Down

0 comments on commit 80ef421

Please sign in to comment.