beacon_aug/external/textflow/synthesis.py
def plot_annotations(self):
        """
        plot bounding quadrilateral of the text placed on self.image, as well as their baseline and character-wise bbox
        """
        output = np.copy(self.image)
        cv2.drawContours(output, contours=np.array(self.list_bound),
                         contourIdx=-1, color=(255, 0, 0), thickness=1)
        for i in range(len(self.list_bound)):
            cv2.drawContours(
                output, contours=self.list_char_box[i], contourIdx=-1, color=(255, 255, 0), thickness=1)
            cv2.line(output, tuple(self.list_base_line[i][0]), tuple(
                self.list_base_line[i][1]), color=(0, 0, 255))
            cv2.putText(img=output, text=self.list_text[i],
                        org=tuple([np.min(self.list_bound[i][:, 0]), max(
                            10, np.min(self.list_bound[i][:, 1]) - 5)]),
                        fontFace=cv2.FONT_HERSHEY_SIMPLEX, fontScale=.5, color=(255, 0, 255), thickness=1)
        return output

        plot bounding quadrilateral of the text placed on self.image, as well as their baseline and character-wise bbox
        
plot bounding quadrilateral of the text placed on self.image, as well as their baseline and character-wise bbox
plot bounding quadrilateral of the text placed on self . image as well as their baseline and character - wise bbox
def plot_annotations(self):
        output = np.copy(self.image)
        cv2.drawContours(output, contours=np.array(self.list_bound),
                         contourIdx=-1, color=(255, 0, 0), thickness=1)
        for i in range(len(self.list_bound)):
            cv2.drawContours(
                output, contours=self.list_char_box[i], contourIdx=-1, color=(255, 255, 0), thickness=1)
            cv2.line(output, tuple(self.list_base_line[i][0]), tuple(
                self.list_base_line[i][1]), color=(0, 0, 255))
            cv2.putText(img=output, text=self.list_text[i],
                        org=tuple([np.min(self.list_bound[i][:, 0]), max(
                            10, np.min(self.list_bound[i][:, 1]) - 5)]),
                        fontFace=cv2.FONT_HERSHEY_SIMPLEX, fontScale=.5, color=(255, 0, 255), thickness=1)
        return output
def plot_annotations ( self ) : output = np . copy ( self . image ) cv2 . drawContours ( output , contours = np . array ( self . list_bound ) , contourIdx = - 1 , color = ( 255 , 0 , 0 ) , thickness = 1 ) for i in range ( len ( self . list_bound ) ) : cv2 . drawContours ( output , contours = self . list_char_box [ i ] , contourIdx = - 1 , color = ( 255 , 255 , 0 ) , thickness = 1 ) cv2 . line ( output , tuple ( self . list_base_line [ i ] [ 0 ] ) , tuple ( self . list_base_line [ i ] [ 1 ] ) , color = ( 0 , 0 , 255 ) ) cv2 . putText ( img = output , text = self . list_text [ i ] , org = tuple ( [ np . min ( self . list_bound [ i ] [ : , 0 ] ) , max ( 10 , np . min ( self . list_bound [ i ] [ : , 1 ] ) - 5 ) ] ) , fontFace = cv2 . FONT_HERSHEY_SIMPLEX , fontScale = .5 , color = ( 255 , 0 , 255 ) , thickness = 1 ) return output
plot bounding quadrilateral of the text placed on self.image, as well as their baseline and character-wise bbox
plot bounding quadrilateral of the text placed on self . image as well as their baseline and character - wise bbox
"""
        plot bounding quadrilateral of the text placed on self.image, as well as their baseline and character-wise bbox
        """
self