gaotingquan 10 月之前
父節點
當前提交
88a34b543d

+ 0 - 2
paddlex/inference/common/result/base_cv_result.py

@@ -30,8 +30,6 @@ class BaseCVResult(BaseResult, StrMixin, JsonMixin, ImgMixin):
         Raises:
             AssertionError: If the required key (`BaseCVResult.INPUT_IMG_KEY`) are not found in the data.
         """
-        self._img_writer = ImageWriter(backend="pillow")
-
         super().__init__(data)
         StrMixin.__init__(self)
         JsonMixin.__init__(self)

+ 2 - 1
paddlex/inference/models_new/formula_recognition/result.py

@@ -36,7 +36,8 @@ class FormulaRecResult(BaseCVResult):
     def _to_str(self, *args, **kwargs):
         data = copy.deepcopy(self)
         data.pop("input_img")
-        return StrMixin._to_str(data, *args, **kwargs).replace("\\\\", "\\")
+        _str = StrMixin._to_str(data, *args, **kwargs)["res"].replace("\\\\", "\\")
+        return {"res": _str}
 
     def _to_json(self, *args, **kwargs):
         data = copy.deepcopy(self)

+ 5 - 0
paddlex/inference/models_new/image_feature/result.py

@@ -19,6 +19,11 @@ from ...common.result import BaseResult, StrMixin, JsonMixin
 
 
 class IdentityResult(BaseResult, StrMixin, JsonMixin):
+    def __init__(self, data: dict) -> None:
+        super().__init__(data)
+        StrMixin.__init__(self)
+        JsonMixin.__init__(self)
+
     def _to_str(self, *args, **kwargs):
         data = copy.deepcopy(self)
         data.pop("input_img")