本文整理匯總了Python中metrics.add_image_pred_metrics方法的典型用法代碼示例。如果您正苦於以下問題:Python metrics.add_image_pred_metrics方法的具體用法?Python metrics.add_image_pred_metrics怎麽用?Python metrics.add_image_pred_metrics使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類metrics
的用法示例。
在下文中一共展示了metrics.add_image_pred_metrics方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_metrics
# 需要導入模塊: import metrics [as 別名]
# 或者: from metrics import add_image_pred_metrics [as 別名]
def get_metrics(inputs, outputs, params):
"""Aggregate the metrics for rotator model.
Args:
inputs: Input dictionary of the rotator model.
outputs: Output dictionary returned by the rotator model.
params: Hyperparameters of the rotator model.
Returns:
names_to_values: metrics->values (dict).
names_to_updates: metrics->ops (dict).
"""
names_to_values = dict()
names_to_updates = dict()
tmp_values, tmp_updates = metrics.add_image_pred_metrics(
inputs, outputs, params.num_views, 3*params.image_size**2)
names_to_values.update(tmp_values)
names_to_updates.update(tmp_updates)
tmp_values, tmp_updates = metrics.add_mask_pred_metrics(
inputs, outputs, params.num_views, params.image_size**2)
names_to_values.update(tmp_values)
names_to_updates.update(tmp_updates)
for name, value in names_to_values.iteritems():
slim.summaries.add_scalar_summary(
value, name, prefix='eval', print_summary=True)
return names_to_values, names_to_updates
示例2: get_metrics
# 需要導入模塊: import metrics [as 別名]
# 或者: from metrics import add_image_pred_metrics [as 別名]
def get_metrics(inputs, outputs, params):
"""Aggregate the metrics for rotator model.
Args:
inputs: Input dictionary of the rotator model.
outputs: Output dictionary returned by the rotator model.
params: Hyperparameters of the rotator model.
Returns:
names_to_values: metrics->values (dict).
names_to_updates: metrics->ops (dict).
"""
names_to_values = dict()
names_to_updates = dict()
tmp_values, tmp_updates = metrics.add_image_pred_metrics(
inputs, outputs, params.num_views, 3*params.image_size**2)
names_to_values.update(tmp_values)
names_to_updates.update(tmp_updates)
tmp_values, tmp_updates = metrics.add_mask_pred_metrics(
inputs, outputs, params.num_views, params.image_size**2)
names_to_values.update(tmp_values)
names_to_updates.update(tmp_updates)
for name, value in names_to_values.iteritems():
slim.summaries.add_scalar_summary(
value, name, prefix='eval', print_summary=True)
return names_to_values, names_to_updates