cuicheng01 10 месяцев назад
Родитель
Сommit
d9f6820825

+ 3 - 1
paddlex/inference/pipelines_new/ocr/pipeline.py

@@ -372,8 +372,10 @@ class OCRPipeline(BasePipeline):
                             all_subs_of_img
                         )
                     ]
-                    single_img_res["textline_orientation_angle"] = angles
                     all_subs_of_img = self.rotate_image(all_subs_of_img, angles)
+                else:
+                    angles = [-1] * len(all_subs_of_img)
+                single_img_res["textline_orientation_angles"] = angles
 
                 rno = -1
                 for rec_res in self.text_rec_model(all_subs_of_img):

+ 4 - 4
paddlex/inference/pipelines_new/ocr/result.py

@@ -133,13 +133,14 @@ class OCRResult(BaseCVResult):
         data["dt_polys"] = self["dt_polys"]
         data["text_det_params"] = self["text_det_params"]
         data["text_type"] = self["text_type"]
-        if self["model_settings"]["use_textline_orientation"]:
-            data["textline_orientation_angle"] = self["textline_orientation_angle"]
+        # if self["model_settings"]["use_textline_orientation"]:
+        data["textline_orientation_angles"] = self["textline_orientation_angles"]
         data["text_rec_score_thresh"] = self["text_rec_score_thresh"]
         data["rec_texts"] = self["rec_texts"]
         data["rec_scores"] = self["rec_scores"]
         data["rec_polys"] = self["rec_polys"]
         data["rec_boxes"] = self["rec_boxes"]
+        
         return StrMixin._to_str(data, *args, **kwargs)
 
     def _to_json(self, *args, **kwargs) -> Dict[str, str]:
@@ -161,8 +162,7 @@ class OCRResult(BaseCVResult):
         data["dt_polys"] = self["dt_polys"]
         data["text_det_params"] = self["text_det_params"]
         data["text_type"] = self["text_type"]
-        if self["model_settings"]["use_textline_orientation"]:
-            data["textline_orientation_angle"] = self["textline_orientation_angle"]
+        data["textline_orientation_angle"] = self["textline_orientation_angle"]
         data["text_rec_score_thresh"] = self["text_rec_score_thresh"]
         data["rec_texts"] = self["rec_texts"]
         data["rec_scores"] = self["rec_scores"]

+ 11 - 1
paddlex/utils/pipeline_arguments.py

@@ -105,8 +105,17 @@ PIPELINE_ARGUMENTS = {
             "help": "Sets the threshold for vehicle attribute recognition.",
         },
     ],
-    "ts_classification": None,
+    "table_recognition": None,
+    "layout_parsing": None,
+    "seal_recognition": None,
+    "ts_cls": None,
+    "ts_fc": None,
+    "ts_ad": None,
     "formula_recognition": None,
+    "instance_segmentation": None,
+    "semantic_segmentation": None,
+    "small_object_detection": None,
+    "anomaly_detection": None,
     "video_classification": [
         {
             "name": "--topk",
@@ -114,4 +123,5 @@ PIPELINE_ARGUMENTS = {
             "help": "Sets the Top-K value for video classification.",
         },
     ],
+
 }