File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 16
16
# arguments from the pipeline class, to reduce boilerplate and improve
17
17
# maintainability?
18
18
19
+ import os
19
20
import sys
20
21
import warnings
21
22
@@ -109,6 +110,20 @@ def __init__(
109
110
text_detection_model_name = det_model_name
110
111
text_recognition_model_name = rec_model_name
111
112
else :
113
+ if (
114
+ text_detection_model_dir is not None
115
+ and text_detection_model_name is None
116
+ ):
117
+ text_detection_model_name = os .path .basename (text_detection_model_dir )
118
+
119
+ if (
120
+ text_recognition_model_dir is not None
121
+ and text_recognition_model_name is None
122
+ ):
123
+ text_recognition_model_name = os .path .basename (
124
+ text_recognition_model_dir
125
+ )
126
+
112
127
if lang is not None or ocr_version is not None :
113
128
warnings .warn (
114
129
"`lang` and `ocr_version` will be ignored when model names or model directories are not `None`." ,
You can’t perform that action at this time.
0 commit comments