|
|
@@ -140,7 +140,11 @@ class OCRResult(BaseCVResult):
|
|
|
data["model_settings"] = self["model_settings"]
|
|
|
if self["model_settings"]["use_doc_preprocessor"]:
|
|
|
data["doc_preprocessor_res"] = self["doc_preprocessor_res"].str["res"]
|
|
|
- data["dt_polys"] = self["dt_polys"]
|
|
|
+ data["dt_polys"] = (
|
|
|
+ self["dt_polys"]
|
|
|
+ if self["text_type"] == "seal"
|
|
|
+ else np.array(self["dt_polys"])
|
|
|
+ )
|
|
|
data["text_det_params"] = self["text_det_params"]
|
|
|
data["text_type"] = self["text_type"]
|
|
|
if "textline_orientation_angles" in self:
|
|
|
@@ -150,7 +154,11 @@ class OCRResult(BaseCVResult):
|
|
|
data["text_rec_score_thresh"] = self["text_rec_score_thresh"]
|
|
|
data["rec_texts"] = self["rec_texts"]
|
|
|
data["rec_scores"] = np.array(self["rec_scores"])
|
|
|
- data["rec_polys"] = self["rec_polys"]
|
|
|
+ data["rec_polys"] = (
|
|
|
+ self["rec_polys"]
|
|
|
+ if self["text_type"] == "seal"
|
|
|
+ else np.array(self["rec_polys"])
|
|
|
+ )
|
|
|
data["rec_boxes"] = np.array(self["rec_boxes"])
|
|
|
|
|
|
return JsonMixin._to_str(data, *args, **kwargs)
|