Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
harish2704 committed Oct 2, 2019
1 parent dcee00e commit 9713a65
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pottan_ocr/ocr_hocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,12 @@ def main( args ):
img_word = img.crop( cords )
img_word = resize_img( img_word, lineHeight )
img_words.append( img_word )

ocr_res = ocr_images( model, img_words )
for el, txt in zip( el_words, ocr_res):
for child in el.getchildren(): el.remove( child )
el.text = txt

# Word based ocr
# children = el.getchildren()
# if( len( children ) ):
# children[0].text = txt
# else:
# el.text = txt
writeFile( args.output, dom.html().replace('</head>', "<style> .ocr_line{ display: block; } </style></head>" ) )

if( __name__ == '__main__' ):
Expand Down

0 comments on commit 9713a65

Please sign in to comment.