class_docstr: refer: https://github.com/xuebinqin/DIS/blob/main/IS-Net/basics.py
class_docstr_tok: ["refer",":","https",":","\/\/github.com\/xuebinqin\/DIS\/blob\/main\/IS-Net\/basics.py"]
code: def compute(self):
      pre_mean = self.precision_cum / self.num_cum
      rec_mean = self.recall_cum / self.num_cum
      f1_mean = (
          (1 + 0.3)
          * pre_mean
          * rec_mean
          / (0.3 * pre_mean + rec_mean + 1e-8)
      )
      max_f1 = torch.amax(f1_mean).item()
      return max_f1
  
imports: from collections import defaultdict, deque
  import datetime
  import time
  import torch
  import torch.distributed
  import torch.nn.functional
  import errno
  import os
label_desc: Use image node_id 3 for calling the F1Score obj's underlying member method code with example usage: obj.compute() and returns: max_f1