def generate_data_for_nn_app(images_ids, figures_ids, annotations, padding):
    data_for_inference = []
    for (index, (image_id, figure_id, label)) in enumerate(zip(images_ids, figures_ids, annotations)):
        if (label is None):
            raise ValueError(f'Label with id={figure_id} not found. Maybe cached annotation differs from the actual one. Please clear cache on settings tab')
        image_info = g.spawn_api.image.get_info_by_id(image_id)
        image_url = image_info.full_storage_url
        bbox = sly_annotation_to_bbox(label)
        data_for_inference.append({'index': index, 'url': image_url, 'bbox': bbox, 'figure_id': figure_id})
    return data_for_inference
def generate_data_for_nn_app(images_ids, figures_ids, annotations, padding):
    data_for_inference = []
    for (index, (image_id, figure_id, label)) in enumerate(zip(images_ids, figures_ids, annotations)):
        if (label is None):
            raise ValueError(f'Label with id={figure_id} not found. Maybe cached annotation differs from the actual one. Please clear cache on settings tab')
        image_info = g.spawn_api.image.get_info_by_id(image_id)
        image_url = image_info.full_storage_url
        bbox = sly_annotation_to_bbox(label)
        data_for_inference.append({'index': index, 'url': image_url, 'bbox': bbox, 'figure_id': figure_id})
    return data_for_inference