Error message when importing ground truth labels of videos: Video data row is missing frames, segments and answers

Hi, I try to import ground truth labels of videos to labelbox.

The help page was updated yesterday, but the function get_ground_truth_label is unknown.
Then I try it according to the previous cache page, but obtained the error of the title by printing upload_task.errors[0]:

{'uuid': uuid, 'dataRow': {'id': id}, 'status': 'FAILURE', 'errors': [{'name': 'MissingFramesData', 'message': 'Video data row is missing frames, segments and answers, with ID: ID, 'additionalInfo': None}]}

I think the frame information is necessary for upload_task object because the above example is for images (not videos), but I cannot add this inofrmation.

Do you know the solution for this? Thanks.

@fujii, the get_ground_truth_label function is a placeholder that is intended to be replaced by your own function.

For any given data row, there are a number of ways in which you may determine what annotations should be applied. For example, some people might be importing predictions generated from a model, while others may be manually determining the annotations to be added. For any given data row, the label that you want to create must be determined by a function of your own.

As to your second question, the frame information is not necessary when uploading annotations onto images. If you are continually facing this issue when trying to upload annotations onto an image, please turn to our customer support portal and report an issue. Our team will be happy to help triage and discuss!

@Zeke_Labelbox Thanks for the reply!
I understand about get_ground_truth_label function.

My main (2nd) question is about importing labels of videos, not images.
Could you tell me the solution for the error of the title Video data row is missing frames, segments and answers if you know? Thanks.

@fujii Can you please share with me the line of code that you are running that results in this error message?

@Zeke_Labelbox Thanks, my code is:

labels = LabelList()
for datarow in queued_data_rows:
    uploads = []
    for annot in annotations_input[datarow["externalId"]]:
        class_name = annot['name']
        bbox = annot['bbox']
        frame = annot['frameNumber']

        # Create an annotation type 
            name = class_name,
            value = Rectangle.from_xyhw(*bbox),

        # cache help version but got a similar result
        '''bbox = annot['bbox']
                value=Rectangle.from_xyhw(bbox[0], bbox[1], bbox[3], bbox[2]),

        labels.append(Label(data=VideoData(uid=datarow['id']), annotations=uploads)) # ,frames=frame

# Convert names to feature schema ids
labels_ndjson = list(NDJsonConverter.serialize(labels))

print('undistorted labels_ndjson for uploading is created')

# Step 2: upload annotations
import time
from uuid import uuid4
from labelbox.schema.annotation_import import LabelImport

start_time = time.time()

# Upload annotations
upload_task = LabelImport.create_from_objects(client, project.uid, f"upload-job-{uuid4()}", labels_ndjson)

# Wait for upload to finish

I confirmed annotations_input and datarow are created correctly.

The error is obtained in the last print command such that

{'uuid': '16e12bad-619b-4298-b88c-1210d10b6eec', 'dataRow': {'id': 'cl97z2x0ywdy90854cwvxbj4s'}, 'status': 'FAILURE', 'errors': [{'name': 'MissingFramesData', 'message': 'Video data row is missing frames, segments and answers, with ID: cl97z2x0ywdy90854cwvxbj4s', 'additionalInfo': None}]}

Thanks for your consideration.

@fujii Ah, I understand now.

Have you had a chance to check out the format that is specific to importing annotations on video assets? If not, please take a look at this Google Colab tutorial.

@Zeke_Labelbox Many thanks. I successfully imported the labels based on the tutorial.