code: def __init__(self, args):
      super().__init__(args)
  
      # Let's use MusiCNN for testing. If it uses half-overlapped 3-second patches and
      # we want predictions from 2 patches, we need 4.5 seconds of audio.
      self.sr = 16000
      self.time = 4.5
      self.nsamples = int(self.sr * self.time)
  
      # Using synthetic noise to speed up the tests.
      numpy.random.seed(6)
      self.audio = numpy.random.rand(self.nsamples).astype("float32")
  
      # Using `genre_dortmund_musicnn_msd.pb` because it is the MusiCNN model we have in our repo.
      # We can extract the generic MusiCNN embeddings from the first dense layer of the model.
      self.embedding_model_name = join(
          testdata.models_dir,
          "musicnn",
          "genre_dortmund_musicnn_msd.pb",
      )
      # A typical use case of this algorithm is the inference with embedding-based classifiers.
      self.head_model_name = join(
          testdata.models_dir,
          "classification_heads",
          "emomusic-msd-musicnn-1.pb",
      )
  
      self.head_input_name = "flatten_in_input"
      self.head_output_name = "dense_out"
  
      # Get the expected results with the generic TensorflowPredict() algorithm.
      self.embeddings, self.expected = self.getExpectedResults()
  
file_path: essentia/test/src/unittests/machinelearning/test_tensorflowpredict2d.py
imports: from essentia_test import *
  import essentia.streaming
label_desc: Use image node_id 1 to create a new TestTensorFlowPredict2D object from inherited base classes: TestCase with example: obj = TestTensorFlowPredict2D(args)