class_docstr: SingingGenerate class
  
  Examples:
      >>> import soundfile
      >>> svs = SingingGenerate("config.yml", "model.pth")
      >>> wav = svs("Hello World")[0]
      >>> soundfile.write("out.wav", wav.numpy(), svs.fs, "PCM_16")
class_docstr_tok: ["SingingGenerate","class","Examples",":",">",">",">","import","soundfile",">",">",">","svs","=","SingingGenerate","(","``","config.yml","''",",","``","model.pth","''",")",">",">",">","wav","=","svs","(","``","Hello","World","''",")","[","0","]",">",">",">","soundfile.write","(","``","out.wav","''",",","wav.numpy","(",")",",","svs.fs",",","``","PCM_16","''",")"]
code: def __call__(
      self,
      text: Union[Dict[str, Tuple], torch.Tensor, np.ndarray],
      singing: Union[torch.Tensor, np.ndarray] = None,
      label: Union[torch.Tensor, np.ndarray] = None,
      midi: Union[torch.Tensor, np.ndarray] = None,
      duration_phn: Union[torch.Tensor, np.ndarray] = None,
      duration_ruled_phn: Union[torch.Tensor, np.ndarray] = None,
      duration_syb: Union[torch.Tensor, np.ndarray] = None,
      phn_cnt: Union[torch.Tensor, np.ndarray] = None,
      slur: Union[torch.Tensor, np.ndarray] = None,
      pitch: Union[torch.Tensor, np.ndarray] = None,
      energy: Union[torch.Tensor, np.ndarray] = None,
      spembs: Union[torch.Tensor, np.ndarray] = None,
      sids: Union[torch.Tensor, np.ndarray] = None,
      lids: Union[torch.Tensor, np.ndarray] = None,
      decode_conf: Optional[Dict[str, Any]] = None,
  ):
      assert check_argument_types()
  
      # check inputs
      if self.use_sids and sids is None:
          raise RuntimeError("Missing required argument: 'sids'")
      if self.use_lids and lids is None:
          raise RuntimeError("Missing required argument: 'lids'")
      if self.use_spembs and spembs is None:
          raise RuntimeError("Missing required argument: 'spembs'")
  
      # prepare batch
      if isinstance(text, Dict):
          data = self.preprocess_fn(
              "<dummy>", dict(label=text["label"], score=text["score"])
          )
          label = data["label"]
          midi = data["midi"]
          duration_phn = data["duration_phn"]
          duration_ruled_phn = data["duration_ruled_phn"]
          duration_syb = data["duration_syb"]
          phn_cnt = data["phn_cnt"]
          slur = data["slur"]
          batch = dict(text=data["label"])
      else:
          batch = dict(text=text)
  
      if singing is not None:
          batch.update(singing=singing)
      if label is not None:
          batch.update(label=label)
      if midi is not None:
          batch.update(midi=midi)
      if duration_phn is not None:
          batch.update(duration_phn=duration_phn)
      if duration_ruled_phn is not None:
          batch.update(duration_ruled_phn=duration_ruled_phn)
      if duration_syb is not None:
          batch.update(duration_syb=duration_syb)
      if pitch is not None:
          batch.update(pitch=pitch)
      if phn_cnt is not None:
          batch.update(phn_cnt=phn_cnt)
      if slur is not None:
          batch.update(slur=slur)
      if energy is not None:
          batch.update(energy=energy)
      if spembs is not None:
          batch.update(spembs=spembs)
      if sids is not None:
          batch.update(sids=sids)
      if lids is not None:
          batch.update(lids=lids)
      batch = to_device(batch, self.device)
  
      cfg = self.decode_conf
      if decode_conf is not None:
          cfg = self.decode_conf.copy()
          cfg.update(decode_conf)
      output_dict = self.model.inference(**batch, **cfg)
  
      if output_dict.get("att_w") is not None:
          duration, focus_rate = self.duration_calculator(
              output_dict["att_w"]
          )
          output_dict.update(duration=duration, focus_rate=focus_rate)
      else:
          output_dict.update(duration=None, focus_rate=None)
  
      # apply vocoder (mel-to-wav)
      if self.vocoder is not None:
          if (
              self.prefer_normalized_feats
              or output_dict.get("feat_gen_denorm") is None
          ):
              input_feat = output_dict["feat_gen"]
          else:
              input_feat = output_dict["feat_gen_denorm"]
          wav = self.vocoder(input_feat)
          output_dict.update(wav=wav)
  
      return output_dict
  
imports: import argparse
  import logging
  import shutil
  import sys
  import time
  from pathlib import Path
  from typing import Any, Dict, Optional, Sequence, Tuple, Union
  import numpy
  import soundfile
  import torch
  from typeguard import check_argument_types
  from espnet2.fileio.npy_scp import NpyScpWriter
  from espnet2.gan_svs.vits import VITS
  from espnet2.svs.singing_tacotron.singing_tacotron import singing_tacotron
  from espnet2.tasks.svs import SVSTask
  from espnet2.torch_utils.device_funcs import to_device
  from espnet2.torch_utils.set_all_random_seed import set_all_random_seed
  from espnet2.tts.utils import DurationCalculator
  from espnet2.utils import config_argparse
  from espnet2.utils.types import str2bool, str2triple_str, str_or_none
  from espnet.utils.cli_utils import get_commandline_args
label_desc: Use image node_id 2 for calling the SingingGenerate obj's underlying member method code with example usage: obj.__call__(text, singing, label, midi, duration_phn, duration_ruled_phn, duration_syb, phn_cnt, slur, pitch, energy, spembs, sids, lids, decode_conf) and returns: output_dict