Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_volume_iou_metrics(inputs, outputs):
- """Computes the per-instance volume IOU.
- Args:
- inputs: Input dictionary of the voxel generation model.
- outputs: Output dictionary returned by the voxel generation model.
- Returns:
- names_to_values: metrics->values (dict).
- names_to_updates: metrics->ops (dict).
- """
- names_to_values = dict()
- names_to_updates = dict()
- print("*************************")
- print(inputs)
- print(outputs)
- labels = tf.greater_equal(inputs, 0.5)
- predictions = tf.greater_equal(outputs, 0.5)
- labels = (2 - tf.to_int32(labels))-1 #normalisieren auf 1,2 (we think 2 is empty/free), 1 is ground truth occupied
- predictions = (3 - tf.to_int32(predictions) * 2)-1 # 3=predicted free, 1=predicted occupied,
- #so we get intersection only for number 1, predicted occupied
- #labels= tf.Print(labels, [labels], message="This is the labels: ", summarize=100)
- #labels= tf.Print(labels, [predictions], message="This is the predictions: ",summarize=100)
- tmp_values, tmp_updates = tf.metrics.mean_iou(
- labels=labels,# we add -1 because the tf metrics expects it probably to start from zero
- predictions=predictions,
- num_classes=3)
- tmp_values=tf.Print(tmp_values,[tmp_values])
- names_to_values['volume_iou'] = tmp_values * 3.0
- names_to_updates['volume_iou'] = tmp_updates
- return names_to_values, names_to_updates
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement