mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-22 17:23:01 +00:00
fix water depth fiddling
This commit is contained in:
parent
46d1f5e4e0
commit
fefeb5d531
1 changed files with 7 additions and 2 deletions
|
@ -30,11 +30,16 @@ def parse_item(metadata, shape_water_desired, water_threshold=0.1, water_bins=2)
|
||||||
|
|
||||||
# SHAPES:
|
# SHAPES:
|
||||||
# rainfall = [ feature_dim ]
|
# rainfall = [ feature_dim ]
|
||||||
# water = [ width, height, 1 ]
|
# water = [ height, width, 1 ] # yes, this is correct
|
||||||
|
|
||||||
water = tf.cast(tf.math.greater_equal(water, water_threshold), dtype=tf.int32)
|
water = tf.cast(tf.math.greater_equal(water, water_threshold), dtype=tf.int32)
|
||||||
|
|
||||||
water = tf.image.crop_to_bounding_box(water, water_offset_x, water_offset_y, water_width_target, water_height_target)
|
water = tf.image.crop_to_bounding_box(water,
|
||||||
|
offset_height=water_offset_y,
|
||||||
|
offset_width =water_offset_x,
|
||||||
|
target_height=water_height_target,
|
||||||
|
target_width =water_width_target,
|
||||||
|
)
|
||||||
water = tf.one_hot(water, water_bins, axis=-1, dtype=tf.int32)
|
water = tf.one_hot(water, water_bins, axis=-1, dtype=tf.int32)
|
||||||
water = tf.reshape(water, tf.constant([water_width_target, water_height_target, water_bins], dtype=tf.int32))
|
water = tf.reshape(water, tf.constant([water_width_target, water_height_target, water_bins], dtype=tf.int32))
|
||||||
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