Imported from https://github.com/telecombcn-dl/2018-dlcv-team2