Browse Source

add seal pipeline

Sunting78 1 năm trước cách đây
mục cha
commit
325d087953

+ 5 - 5
paddlex/inference/pipelines/seal_recognition/seal_recognition.py → paddlex/inference/pipelines/seal_recognition.py

@@ -81,29 +81,29 @@ class SealOCRPipeline(BasePipeline):
         layout_batch_size=None,
         text_det_batch_size=None,
         text_rec_batch_size=None,
-        device=None,
+        # device=None,
     ):
         if text_det_batch_size and text_det_batch_size > 1:
             logging.warning(
                 f"text det model only support batch_size=1 now,the setting of text_det_batch_size={text_det_batch_size} will not using! "
             )
         if layout_batch_size:
-            self.layout_predictor.set_predictor(batch_size=layout_batch_size, device=device)
+            self.layout_predictor.set_predictor(batch_size=layout_batch_size)
         if text_rec_batch_size:
             self.ocr_pipeline.text_rec_model.set_predictor(
-                batch_size=text_rec_batch_size, device=device
+                batch_size=text_rec_batch_size
             )
 
     def predict(self, x, **kwargs):
         layout_batch_size = kwargs.get("layout_batch_size")
         text_det_batch_size = kwargs.get("text_det_batch_size")
         text_rec_batch_size = kwargs.get("text_rec_batch_size")
-        device = kwargs.get("device")
+        # device = kwargs.get("device")
         self.set_predictor(
             layout_batch_size,
             text_det_batch_size,
             text_rec_batch_size,
-            device,
+            # device,
         )
         for layout_pred in self.layout_predictor(x):
             single_img_res = {

+ 0 - 15
paddlex/inference/pipelines/seal_recognition/__init__.py

@@ -1,15 +0,0 @@
-# copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from .seal_recognition import SealOCRPipeline