File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -1216,7 +1216,7 @@ CV__DNN_INLINE_NS_BEGIN
1216
1216
* KeypointsModel creates net from file with trained weights and config,
1217
1217
* sets preprocessing input, runs forward pass and returns the x and y coordinates of each detected keypoint
1218
1218
*/
1219
- class CV_EXPORTS_W KeypointsModel: public Model
1219
+ class CV_EXPORTS_W_SIMPLE KeypointsModel: public Model
1220
1220
{
1221
1221
public:
1222
1222
/* *
@@ -1248,7 +1248,7 @@ CV__DNN_INLINE_NS_BEGIN
1248
1248
* SegmentationModel creates net from file with trained weights and config,
1249
1249
* sets preprocessing input, runs forward pass and returns the class prediction for each pixel.
1250
1250
*/
1251
- class CV_EXPORTS_W SegmentationModel: public Model
1251
+ class CV_EXPORTS_W_SIMPLE SegmentationModel: public Model
1252
1252
{
1253
1253
public:
1254
1254
/* *
@@ -1406,7 +1406,7 @@ class CV_EXPORTS_W_SIMPLE TextRecognitionModel : public Model
1406
1406
1407
1407
/* * @brief Base class for text detection networks
1408
1408
*/
1409
- class CV_EXPORTS_W TextDetectionModel : public Model
1409
+ class CV_EXPORTS_W_SIMPLE TextDetectionModel : public Model
1410
1410
{
1411
1411
protected:
1412
1412
CV_DEPRECATED_EXTERNAL // avoid using in C++ code, will be moved to "protected" (need to fix bindings first)
Original file line number Diff line number Diff line change @@ -197,6 +197,25 @@ def test_classification_model(self):
197
197
normAssert (self , out , ref )
198
198
199
199
200
+ def test_textdetection_model (self ):
201
+ img_path = self .find_dnn_file ("dnn/text_det_test1.png" )
202
+ weights = self .find_dnn_file ("dnn/onnx/models/DB_TD500_resnet50.onnx" , required = False )
203
+ if weights is None :
204
+ raise unittest .SkipTest ("Missing DNN test files (onnx/models/DB_TD500_resnet50.onnx). Verify OPENCV_DNN_TEST_DATA_PATH configuration parameter." )
205
+
206
+ frame = cv .imread (img_path )
207
+ scale = 1.0 / 255.0
208
+ size = (736 , 736 )
209
+ mean = (122.67891434 , 116.66876762 , 104.00698793 )
210
+
211
+ model = cv .dnn_TextDetectionModel_DB (weights )
212
+ model .setInputParams (scale , size , mean )
213
+ out , _ = model .detect (frame )
214
+
215
+ self .assertTrue (type (out ) == list )
216
+ self .assertTrue (np .array (out ).shape == (2 , 4 , 2 ))
217
+
218
+
200
219
def test_face_detection (self ):
201
220
proto = self .find_dnn_file ('dnn/opencv_face_detector.prototxt' )
202
221
model = self .find_dnn_file ('dnn/opencv_face_detector.caffemodel' , required = False )
You can’t perform that action at this time.
0 commit comments