class_docstr: Arguments:
      threshold (float): Threshold for classifier confidence score
class_docstr_tok: ["Arguments",":","threshold","(","float",")",":","Threshold","for","classifier","confidence","score"]
code: def setup(self, threshold=0.85):
      self.threshold = threshold
      try_to_import_pillow()
      try_to_import_torch()
      try_to_import_torchvision()
  
      import torch
      import torch.nn.functional as F
  
      model_url = "https://www.dropbox.com/s/85b63eahka5r439/emotion_detector.t7?raw=1"
      model_weights_path = torch.hub.get_dir() + "/emotion_detector.t7"
      # pull model weights from dropbox if not present
      self._download_weights(model_url, model_weights_path)
  
      # helper class for VGG
      class VGG(torch.nn.Module):
          def __init__(self, vgg_name):
              super(VGG, self).__init__()
              self.features = self._make_layers(cfg[vgg_name])
              self.classifier = torch.nn.Linear(512, 7)
  
          def forward(self, x):
              out = self.features(x)
              out = out.view(out.size(0), -1)
              out = F.dropout(out, p=0.5, training=self.training)
              out = self.classifier(out)
              return out
  
          def _make_layers(self, cfg):
              layers = []
              in_channels = 3
              for x in cfg:
                  if x == "M":
                      layers += [
                          torch.nn.MaxPool2d(kernel_size=2, stride=2)
                      ]
                  else:
                      layers += [
                          torch.nn.Conv2d(
                              in_channels, x, kernel_size=3, padding=1
                          ),
                          torch.nn.BatchNorm2d(x),
                          torch.nn.ReLU(inplace=True),
                      ]
                      in_channels = x
              layers += [torch.nn.AvgPool2d(kernel_size=1, stride=1)]
              return torch.nn.Sequential(*layers)
  
      # load model
      self.model = VGG("VGG19")
  
      # self.get_device() infers device from the loaded model, so not using it
      device = torch.device(
          "cuda" if torch.cuda.is_available() else "cpu"
      )
      model_state = torch.load(model_weights_path, map_location=device)
      self.model.load_state_dict(model_state["net"])
      self.model.eval()
  
      # for augmentation
      self.cut_size = 44
  
file_path: evadb/evadb/functions/emotion_detector.py
imports: import os
  from typing import List
  import numpy
  import pandas
  from evadb.functions.abstract.pytorch_abstract_function import PytorchAbstractClassifierFunction
  from evadb.utils.generic_utils import try_to_import_pillow, try_to_import_torch, try_to_import_torchvision
label_desc: Use image node_id 3 for calling the EmotionDetector obj's underlying member method code with example usage: obj.setup(threshold) and returns: out, torch