This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| class IPM(object): | |
| """ | |
| Inverse perspective mapping to a bird-eye view. Assume pin-hole camera model. | |
| There are detailed explanation of every step in the comments, and variable names in the code follow these conventions: | |
| `_c` for camera coordinates | |
| `_w` for world coordinates | |
| `uv` for perspective transformed uv 2d coordinates (the input image) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.models import Sequential | |
| from keras.layers.core import Dense, Dropout, Activation, Flatten | |
| from keras.layers.convolutional import Convolution2D, MaxPooling2D | |
| from keras.layers.normalization import BatchNormalization | |
| #AlexNet with batch normalization in Keras | |
| #input image is 224x224 | |
| model = Sequential() | |
| model.add(Convolution2D(64, 3, 11, 11, border_mode='full')) |