فهرست منبع

fix_shapely_error (#2723)

Sunflower7788 11 ماه پیش
والد
کامیت
ee04f1a697
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      paddlex/inference/pipelines_new/components/common/crop_image_regions.py

+ 2 - 0
paddlex/inference/pipelines_new/components/common/crop_image_regions.py

@@ -520,6 +520,8 @@ class CropByPolys(BaseOperator):
         def get_intersection(pD, pG):
             return Polygon(pD).intersection(Polygon(pG)).area
 
+        if not Polygon(points).is_valid:
+            return temp_crop_img
         cal_IoU = get_intersection_over_union(points, temp_box)
 
         if cal_IoU >= 0.7: