class_docstr: `TMMetrics` use torchmetric as the implementation of metrics.
  
  Args:
      metric_name (`str`):
          Indicate which metric is used to evalute.
  
  Example:
      >>> from towhee.trainer.metrics import show_avaliable_metrics, get_metric_by_name
      >>> from towhee.trainer.metrics import TMMetrics
      >>> import torch
      >>> pred = torch.FloatTensor([1.0,1.0,1.0,0.0,0.0,0.0])
      >>> gt = torch.IntTensor([1,1,1,1,1,1])
      >>> metric =  TMMetrics('Accuracy')
      >>> metric.update(pred, gt)
      >>> pred = torch.FloatTensor([1.0,1.0,1.0,1.0,1.0,1.0])
      >>> gt = torch.IntTensor([1,1,1,1,1,1])
      >>> metric.update(pred, gt)
      >>> metric.compute().item()
      0.75
      >>> metric.reset()
      >>> pred = torch.FloatTensor([1.0,1.0,1.0,0.0,0.0,0.0])
      >>> gt = torch.IntTensor([1,1,1,1,1,1])
      >>> metric.update(pred, gt)
      >>> metric.compute().item()
      0.5
class_docstr_tok: ["`","TMMetrics","`","use","torchmetric","as","the","implementation","of","metrics",".","Args",":","metric_name","(","`","str","`",")",":","Indicate","which","metric","is","used","to","evalute",".","Example",":",">",">",">","from","towhee.trainer.metrics","import","show_avaliable_metrics",",","get_metric_by_name",">",">",">","from","towhee.trainer.metrics","import","TMMetrics",">",">",">","import","torch",">",">",">","pred","=","torch.FloatTensor","(","[","1.0,1.0,1.0,0.0,0.0,0.0","]",")",">",">",">","gt","=","torch.IntTensor","(","[","1,1,1,1,1,1","]",")",">",">",">","metric","=","TMMetrics","(","'Accuracy","'",")",">",">",">","metric.update","(","pred",",","gt",")",">",">",">","pred","=","torch.FloatTensor","(","[","1.0,1.0,1.0,1.0,1.0,1.0","]",")",">",">",">","gt","=","torch.IntTensor","(","[","1,1,1,1,1,1","]",")",">",">",">","metric.update","(","pred",",","gt",")",">",">",">","metric.compute","(",")",".item","(",")","0.75",">",">",">","metric.reset","(",")",">",">",">","pred","=","torch.FloatTensor","(","[","1.0,1.0,1.0,0.0,0.0,0.0","]",")",">",">",">","gt","=","torch.IntTensor","(","[","1,1,1,1,1,1","]",")",">",">",">","metric.update","(","pred",",","gt",")",">",">",">","metric.compute","(",")",".item","(",")","0.5"]
code: def compute(self) -> str:
      return self._metric.compute()
  
imports: from typing import Any, Dict
  import torchmetrics
  from torchmetrics.detection.map import MeanAveragePrecision
label_desc: Use image node_id 4 for calling the TMMetrics obj's underlying member method code with example usage: obj.compute() and returns: self