gaotingquan 1 vuosi sitten
vanhempi
commit
6628e52c8f

+ 4 - 3
paddlex/inference/components/task_related/seal_det_warp.py

@@ -19,6 +19,8 @@ import cv2
 import copy
 import time
 
+from ....utils import logging
+
 
 def Homography(
     image,
@@ -852,7 +854,7 @@ class AutoRectifier:
                     dst_img = img_list[loss_list.index(min_loss)]
 
                     if min_loss >= loss_thresh:
-                        print(
+                        logging.warning(
                             "calibration loss: {} is too large for spatial transformer. It is failed. Using get_rotate_crop_image".format(
                                 loss
                             )
@@ -860,9 +862,8 @@ class AutoRectifier:
                         dst_img = self.get_rotate_crop_image(
                             image_data, points, interpolation, ratio_width, ratio_height
                         )
-                        print("here")
             except Exception as e:
-                print(e)
+                logging.warning(f"Exception caught: {e}")
                 dst_img = self.get_rotate_crop_image(
                     image_data, points, interpolation, ratio_width, ratio_height
                 )

+ 3 - 3
paddlex/inference/results/ts.py

@@ -23,15 +23,15 @@ class _BaseTSResult(BaseResult, CSVMixin):
 
 
 class TSFcResult(_BaseTSResult):
-    def _to_csv(self, save_path):
+    def _to_csv(self):
         return self["forecast"]
 
 
 class TSClsResult(_BaseTSResult):
-    def save_to_csv(self, save_path):
+    def _to_csv(self):
         return self["classification"]
 
 
 class TSAdResult(_BaseTSResult):
-    def save_to_csv(self, save_path):
+    def _to_csv(self):
         return self["anomaly"]

+ 1 - 2
paddlex/inference/utils/io/writers.py

@@ -194,8 +194,7 @@ class _BaseWriterBackend(object):
 
     def write_obj(self, out_path, obj):
         """write object"""
-        out_dir = os.path.dirname(out_path)
-        os.makedirs(out_dir, exist_ok=True)
+        Path(out_path).parent.mkdir(parents=True, exist_ok=True)
         return self._write_obj(out_path, obj)
 
     def _write_obj(self, out_path, obj):

+ 2 - 2
paddlex/paddlex_cli.py

@@ -93,8 +93,8 @@ def install(args):
 
 def pipeline_predict(pipeline, input, device=None, save_dir=None):
     """pipeline predict"""
-    pipeline = create_pipeline(pipeline)
-    result = pipeline(input, device=device)
+    pipeline = create_pipeline(pipeline, device=device)
+    result = pipeline(input)
     for res in result:
         res.print(json_format=False)
         if save_dir: