code: def segment(self, image: Image.Image) -> np.ndarray:
      rgb = np.array(to_rgb(image))
      shape = rgb.shape[:2]
      net = torch.tensor(rgb, dtype=torch.float32, device=self.device)
      net = net.permute(2, 0, 1)[None]
      net = F.interpolate(net, (1024, 1024), mode="bilinear")
      net = normalize(net / 255.0, [0.5, 0.5, 0.5], [1.0, 1.0, 1.0])
      net = self.model(net)
      net = F.interpolate(net[0][0], shape, mode="bilinear")
      net_min, net_max = net.min(), net.max()
      net = (net - net_min) / (net_max - net_min)
      return net.cpu().numpy()[0][0]
  
imports: import torch
  import numpy
  import torch.nn
  import torch.nn.functional
  from PIL import Image
  from torch import Tensor
  from cftool.cv import to_rgb
  from torchvision.transforms.functional import normalize
  from ....misc.toolkit import download_model
label_desc: Use image node_id 3 for calling the ISNetAPI obj's underlying member method code with example usage: obj.segment(image) and returns: net