Upside down detector: Train a model to detect if images are upside down

The code is taken from: RotNet, with minor changes.