class_docstr: Support data that might occur in a towhee pipeline to json.
class_docstr_tok: ["Support","data","that","might","occur","in","a","towhee","pipeline","to","json","."]
code: def default(self, o):
      if isinstance(o, np.ndarray):
          return NumpyFormat(o).to_dict()
      if o is Empty():
          return EmptyFormat().to_dict()
  
      return json.JSONEncoder.default(self, o)
  
imports: import json
  import numpy
  from towhee.runtime.data_queue import Empty
label_desc: Use image node_id 1 for calling the TritonSerializer obj's underlying member method code with example usage: obj.default(o) and returns: json, NumpyFormat, EmptyFormat