def __init__(self, elems, scaler=<NUM_LIT:1>):
self.log = logging.getLogger(__name__)<EOL>self.scaler = scaler<EOL>layout = elems.layout<EOL>width = int(np.ceil(scaler * layout.width))<EOL>height = int(np.ceil(scaler * layout.height))<EOL>self.grid = np.zeros((width, height), dtype=np.int8)<EOL>self.log.info(self.grid.nbytes / float(<NUM_LIT>))<EOL>for line in elems.segments:<EOL><INDENT>if line.height < <NUM_LIT:0.1>:  <EOL><INDENT>self.draw_rect(line.bbox, self.horizontal_line)<EOL><DEDENT>elif line.width < <NUM_LIT:0.1>:  <EOL><INDENT>self.draw_rect(line.bbox, self.vertical_line)<EOL><DEDENT><DEDENT>for mention in elems.mentions:<EOL><INDENT>self.draw_rect(mention.bbox, self.text)<EOL><DEDENT>for figure in elems.figures:<EOL><INDENT>self.draw_rect(figure.bbox, self.img)<EOL><DEDENT>
Initializes the rendered object grid with specified
scaler so we can map original coordinates into the
new grid map.