def get_objects(predictions: list, img_width: int, img_height: int):
    """Return objects with formatting and extra info."""
    objects = []
    decimal_places = 3
    for pred in predictions:
        if isinstance(pred, str):  # this is image class not object detection so no objects
            return objects
        name = list(pred.keys())[0]

        box_width = pred[name][2]-pred[name][0]
        box_height = pred[name][3]-pred[name][1]
        box = {
            "height": round(box_height / img_height, decimal_places),
            "width": round(box_width / img_width, decimal_places),
            "y_min": round(pred[name][1] / img_height, decimal_places),
            "x_min": round(pred[name][0] / img_width, decimal_places),
            "y_max": round(pred[name][3] / img_height, decimal_places),
            "x_max": round(pred[name][2] / img_width, decimal_places),
        }
        box_area = round(box["height"] * box["width"], decimal_places)
        centroid = {
            "x": round(box["x_min"] + (box["width"] / 2), decimal_places),
            "y": round(box["y_min"] + (box["height"] / 2), decimal_places),
        }
        confidence = round(pred['score'], decimal_places)

        objects.append(
            {
                "bounding_box": box,
                "box_area": box_area,
                "centroid": centroid,
                "name": name,
                "confidence": confidence,
            }
        )
    return objects