code: def default(self, obj):
      if isinstance(obj, np.ndarray):
          return obj.tolist()
      if isinstance(obj, np.float32):
          return str(obj)
      return json.JSONEncoder.default(self, obj)
  
file_path: FARM/farm/inference_rest_api.py
imports: import json
  import logging
  from pathlib import Path
  import numpy
  from flask import Flask, request, make_response
  from flask_cors import CORS
  from flask_restplus import Api, Resource
  from farm.infer import Inferencer
label_desc: Use image node_id 1 for calling the NumpyEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: json, obj, str