Imported from https://github.com/ayanc/rpcnn