Skip to content

Commit 80ef421

Browse files
authored
Fix visualization and correct default model (#237)
1 parent 488fb8e commit 80ef421

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

models/text_detection_ppocr/demo.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ vector< pair<cv::dnn::Backend, cv::dnn::Target> > backendTargetPairs = {
1818

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

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

@@ -172,7 +172,10 @@ int main(int argc, char** argv)
172172
imwrite("result.jpg", originalImage);
173173
}
174174
if (viz)
175+
{
175176
imshow(kWinName, originalImage);
177+
waitKey(0);
178+
}
176179
}
177180
else
178181
imshow(kWinName, originalImage);

0 commit comments

Comments
 (0)