mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-25 18:33:01 +00:00
dataset: namespace → dict
Python is so annoying
This commit is contained in:
parent
dbff15d4a9
commit
c066ea331b
1 changed files with 2 additions and 2 deletions
|
@ -20,13 +20,13 @@ def parse_item(metadata):
|
||||||
})
|
})
|
||||||
rainfall = tf.io.parse_tensor(parsed["rainfallradar"], out_type=tf.float32)
|
rainfall = tf.io.parse_tensor(parsed["rainfallradar"], out_type=tf.float32)
|
||||||
water = tf.io.parse_tensor(parsed["waterdepth"], out_type=tf.float32)
|
water = tf.io.parse_tensor(parsed["waterdepth"], out_type=tf.float32)
|
||||||
|
|
||||||
# [channels, width, height] → [width, height, channels] - ref ConvNeXt does not support data_format=channels_first
|
# [channels, width, height] → [width, height, channels] - ref ConvNeXt does not support data_format=channels_first
|
||||||
|
|
||||||
rainfall = tf.transpose(rainfall, [1, 2, 0])
|
rainfall = tf.transpose(rainfall, [1, 2, 0])
|
||||||
# [width, height] → [width, height, channels]
|
# [width, height] → [width, height, channels]
|
||||||
water = tf.expand_dims(water, axis=-1)
|
water = tf.expand_dims(water, axis=-1)
|
||||||
# BUG: AttributeError: 'dict' object has no attribute 'waterdepth
|
# BUG: AttributeError: 'dict' object has no attribute 'waterdepth
|
||||||
rainfall = tf.image.resize(rainfall, tf.constant(metadata.waterdepth))
|
rainfall = tf.image.resize(rainfall, tf.constant(metadata["waterdepth"]))
|
||||||
|
|
||||||
# TODO: The shape of the resulting tensor can't be statically determined, so we need to reshape here
|
# TODO: The shape of the resulting tensor can't be statically determined, so we need to reshape here
|
||||||
print("DEBUG:dataset ITEM rainfall:shape", rainfall.shape, "water:shape", water.shape)
|
print("DEBUG:dataset ITEM rainfall:shape", rainfall.shape, "water:shape", water.shape)
|
||||||
|
|
Loading…
Reference in a new issue