Imported from https://github.com/xunhen/py-faster-rcnn-wjc