(self, data: dict)
return data
从scales中随机选择一个尺度，对图片和文本框进行缩放
        :param data: {'img':,'text_polys':,'texts':,'ignore_tags':}
        :return:
从scales中随机选择一个尺度，对图片和文本框进行缩放
        :param data: {'img':,'text_polys':,'texts':,'ignore_tags':}
        :return:
从scales中随机选择一个尺度，对图片和文本框进行缩放 : param data : { img : text_polys : texts : ignore_tags : } : return :
def __call__(self, data: dict) -> dict:
        """
        从scales中随机选择一个尺度，对图片和文本框进行缩放
        :param data: {'img':,'text_polys':,'texts':,'ignore_tags':}
        :return:
        """
        im = data['img']
        text_polys = data['text_polys']
        ignore_tags = data['ignore_tags']

        canvas = np.zeros(im.shape[:2], dtype=np.float32)
        mask = np.zeros(im.shape[:2], dtype=np.float32)

        for i in range(len(text_polys)):
            if ignore_tags[i]:
                continue
            self.draw_border_map(text_polys[i], canvas, mask=mask)
        canvas = canvas * (self.thresh_max - self.thresh_min) + self.thresh_min

        data['threshold_map'] = canvas
        data['threshold_mask'] = mask
        return data
def __call__ ( self , data : dict ) -> dict : im = data [ 'img' ] text_polys = data [ 'text_polys' ] ignore_tags = data [ 'ignore_tags' ] canvas = np . zeros ( im . shape [ : 2 ] , dtype = np . float32 ) mask = np . zeros ( im . shape [ : 2 ] , dtype = np . float32 ) for i in range ( len ( text_polys ) ) : if ignore_tags [ i ] : continue self . draw_border_map ( text_polys [ i ] , canvas , mask = mask ) canvas = canvas * ( self . thresh_max - self . thresh_min ) + self . thresh_min data [ 'threshold_map' ] = canvas data [ 'threshold_mask' ] = mask return data