/** * <p> * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each instance * of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, * apparel or pets. * </p> * * @param instances * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each * instance of the detected object. Bounding boxes are returned for common object labels such as people, * cars, furniture, apparel or pets. * @return Returns a reference to this object so that method calls can be chained together. */ public Label withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
/** * <p> * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each instance * of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, * apparel or pets. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each * instance of the detected object. Bounding boxes are returned for common object labels such as people, * cars, furniture, apparel or pets. * @return Returns a reference to this object so that method calls can be chained together. */ public Label withInstances(Instance... instances) { if (this.instances == null) { setInstances(new java.util.ArrayList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
label.setInstances(new ListUnmarshaller<Instance>(InstanceJsonUnmarshaller.getInstance()).unmarshall(context));