class_docstr: Smooths out datatype conversions for IceVision preds to JSON export
class_docstr_tok: ["Smooths","out","datatype","conversions","for","IceVision","preds","to","JSON","export"]
code: def default(self, obj):
      if isinstance(obj, np.integer):
          return int(obj)
      if isinstance(obj, np.floating):
          return float(obj)
      if isinstance(obj, np.ndarray):
          return obj.tolist()
      return json.JSONEncoder.default(self, obj)
  
file_path: icevision/icevision/data/convert_records_to_coco_style.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  import json
  import numpy
  import PIL
label_desc: Use image node_id 1 for calling the NpEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: json, int, float, obj