Commit 70ae1916 authored by Vishnu Banna's avatar Vishnu Banna
Browse files

datapipeline update

parent e01e3c4e
...@@ -320,6 +320,7 @@ def resize_and_jitter_image(image, ...@@ -320,6 +320,7 @@ def resize_and_jitter_image(image,
"""WIP""" """WIP"""
def intersection(a, b): def intersection(a, b):
"""Find the intersection of 2 crop boxes."""
minx = tf.maximum(a[0], b[0]) minx = tf.maximum(a[0], b[0])
miny = tf.maximum(a[1], b[1]) miny = tf.maximum(a[1], b[1])
maxx = tf.minimum(a[2], b[2]) maxx = tf.minimum(a[2], b[2])
...@@ -327,6 +328,7 @@ def resize_and_jitter_image(image, ...@@ -327,6 +328,7 @@ def resize_and_jitter_image(image,
return tf.convert_to_tensor([minx, miny, maxx, maxy]) return tf.convert_to_tensor([minx, miny, maxx, maxy])
def cast(values, dtype): def cast(values, dtype):
"""Cast a list of items to a givne data type to reduce lines of code"""
return [tf.cast(value, dtype) for value in values] return [tf.cast(value, dtype) for value in values]
if jitter > 0.5 or jitter < 0: if jitter > 0.5 or jitter < 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment