-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFDSv4 carla_video_tracking upgrade. #1829
Changes from 1 commit
1200bbc
2d12b3c
873442d
b7bc58e
df90fbb
c0fbbe3
216c4da
bd3621a
c9aec26
1787e0e
98caa12
c74e710
5e92bc3
52d9cde
cda1beb
80cfa6d
41b1686
b7afdd0
f552723
69a6498
83ae25d
3059170
bc069bd
b35df54
09e2df3
de621f6
5b70cec
58bec8d
1ba2c28
02834e4
61a487f
4d8ac63
f8bc198
0b7ffa0
014e1fc
d718e69
ef3b1f7
2577998
07741c5
631e25b
5943015
4ca907b
204097e
5757f0b
53708ef
e1668e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,11 +63,6 @@ def carla_over_obj_det_dev(element, modality="rgb"): | |
return x | ||
|
||
|
||
# @register | ||
# look at the dataset builder file | ||
# @tf.function; then put a breakpoint in the preprocessing function | ||
# tf.set_eagerly true (in slack channel) | ||
# proper integration will be shown with good benign performance | ||
@register | ||
def carla_video_tracking_dev(element, max_frames=None): | ||
return carla_video_tracking( | ||
|
@@ -230,20 +225,6 @@ def canonical_variable_image_preprocess(context, batch): | |
""" | ||
Preprocessing when images are of variable size | ||
""" | ||
# if batch.dtype == np.object: | ||
# for x in batch: | ||
# check_shapes(x.shape, context.x_shape) | ||
# assert x.dtype == context.input_type | ||
# assert x.min() >= context.input_min | ||
# assert x.max() <= context.input_max | ||
|
||
# quantized_batch = np.zeros_like(batch, dtype=np.object) | ||
# for i in range(len(batch)): | ||
# quantized_batch[i] = ( | ||
# batch[i].astype(context.output_type) / context.quantization | ||
# ) | ||
# batch = quantized_batch | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the preprocessor handle pure python objects as done here? |
||
if batch.dtype != context.input_type: | ||
if batch.dtype == object: | ||
raise NotImplementedError( | ||
|
@@ -254,14 +235,6 @@ def canonical_variable_image_preprocess(context, batch): | |
) | ||
check_shapes(tuple(batch.shape), context.x_shape) | ||
assert batch.dtype == context.input_type | ||
# assert tf.math.reduce_min(batch) >= context.input_min | ||
# assert tf.math.reduce_max(batch) <= context.input_max | ||
|
||
# for x in batch: | ||
# assert x.dtype == context.output_type | ||
# assert tf.math.reduce_min(x) >= context.output_min | ||
# assert tf.math.reduce_max(x) <= context.output_max | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is now passed into the dataloader as a function instead of operating on the actual tensor, should this still check the min & max values? TF was complaining about assert statements, but I can look for another way to implement this logic. |
||
return batch | ||
|
||
|
||
|
@@ -278,10 +251,6 @@ def __init__(self, max_frames): | |
self.max_frames = max_frames | ||
|
||
def __call__(self, batch): | ||
# if batch.dtype == np.object: | ||
# clipped_batch = np.empty_like(batch, dtype=np.object) | ||
# clipped_batch[:] = [x[: self.max_frames] for x in batch] | ||
# return clipped_batch | ||
return batch[:, : self.max_frames] | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming
max_frames
gets passed in as adataset_kwargs
but this is untested as I cannot find an example of it being used previously.