createVisionResponse(jsonAPIResponse) {
    let response = new VisionResponse();
    const objResponse = JSON.parse(jsonAPIResponse);
  
    for (let key in objResponse) {
      for (let i = 0; i < objResponse[key].length; i++) {
        //console.log("objResponse[key]["+i+"]: "+JSON.stringify(objResponse[key][i]));
        const bBox = new BoundingBox(key, objResponse[key][i]["x"], objResponse[key][i]["y"], objResponse[key][i]["w"], objResponse[key][i]["h"], objResponse[key][i]["score"]);
        response.addBox(bBox);
      }
    }
    return response;
  }
/************************************************************
   Generate response from the ML Vision
   Input:
   - jsonAPIResponse - response from the Vision API
   Output:
   - VisionResponse - Coordinates of various objects that were recognized
   ************************************************************/
Generate response from the ML Vision
Input:
jsonAPIResponse - response from the Vision API
Output:
VisionResponse - Coordinates of various objects that were recognized
Generate response from the ML Vision Input : jsonAPIResponse - response from the Vision API Output : VisionResponse - Coordinates of various objects that were recognized
createVisionResponse(jsonAPIResponse) {
    let response = new VisionResponse();
    const objResponse = JSON.parse(jsonAPIResponse);
    for (let key in objResponse) {
      for (let i = 0; i < objResponse[key].length; i++) {
        const bBox = new BoundingBox(key, objResponse[key][i]["x"], objResponse[key][i]["y"], objResponse[key][i]["w"], objResponse[key][i]["h"], objResponse[key][i]["score"]);
        response.addBox(bBox);
      }
    }
    return response;
  }
createVisionResponse ( jsonAPIResponse ) { let response = new VisionResponse ( ) ; const objResponse = JSON . parse ( jsonAPIResponse ) ; for ( let key in objResponse ) { for ( let i = 0 ; i < objResponse [ key ] . length ; i ++ ) { const bBox = new BoundingBox ( key , objResponse [ key ] [ i ] [ "x" ] , objResponse [ key ] [ i ] [ "y" ] , objResponse [ key ] [ i ] [ "w" ] , objResponse [ key ] [ i ] [ "h" ] , objResponse [ key ] [ i ] [ "score" ] ) ; response . addBox ( bBox ) ; } } return response ; }
Generate response from the ML Vision
Input:
 jsonAPIResponse - response from the Vision API
Output:
 VisionResponse - Coordinates of various objects that were recognized
Generate response from the ML Vision Input : jsonAPIResponse - response from the Vision API Output : VisionResponse - Coordinates of various objects that were recognized
//console.log("objResponse[key]["+i+"]: "+JSON.stringify(objResponse[key][i]));