This file contains 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
import numpy as np | |
from math import pi | |
def convert(flow): | |
UNKNOWN_FLOW_THRESH = 1e9 | |
h, w, nBands = flow.shape | |
assert nBands == 2, 'flow_to_color: image must have two bands' |
This file contains 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
import tensorflow as tf | |
import numpy as np | |
a = np.array([[1, 4, 7, 10], [11, 44, 77, 110]]) # shape (2, 4) | |
b = np.array([[2, 5, 8, 11], [22, 55, 88, 111]]) # shape (2, 4) | |
c = np.array([[3, 6, 9, 12], [33, 66, 99, 122]]) # shape (2, 4) | |
A = tf.convert_to_tensor(a) | |
B = tf.convert_to_tensor(b) | |
C = tf.convert_to_tensor(c) |