Imported from https://github.com/solivr/tf-crnn