I am trying to add visuals to the project and dataset I created in rekognition custom label using sdk.
I think there is a problem in my manifest.json file, but I can't figure it out.
I followed the solutions for the error at this address but I could not reach a solution:
https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/tm-debugging-aggregate-errors.html
I also use this method:
https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-add-images.html
The mistake I made: "errorMessage": "Dataset update failed: UPDATE_FAILED : The manifest file contains too many invalid rows."
The code snippet I am working on is as follows:
getObjectParams = {
'Bucket': bucket_name,
'Key': manifest_file
}
response = s3Client.get_object(**getObjectParams)
manifestBody = response['Body'].read().decode('utf-8')
changes=json.loads('{ "GroundTruth" : ' +
json.dumps(manifestBody) +
'}')
responseRek = rekognition.update_dataset_entries(
Changes= changes, DatasetArn=dataset_arn_train
)
print("[INFO] -> Response: ",responseRek)
A piece of my manifest.json file:
[
{
"source-ref": "s3://groot20jun23/trainingdata/groot/groot_5.jpg",
"bounding-box": {
"image_size": [
{
"width": 778,
"height": 1000,
"depth": 3
}
],
"annotations": [
{
"class_id": 0,
"top": 5,
"left": 60,
"width": 544,
"height": 729
}
]
},
"bounding-box-metadata": {
"objects": [
{
"confidence": 1
}
],
"class-map": {
"0": "groot"
},
"type": "groundtruth/object-detection",
"human-annotated": "yes",
"creation-date": "2023-06-22T12:22:40.527256",
"job-name": "myjob"
}
},
{
"source-ref": "s3://groot20jun23/trainingdata/groot/groot_6.jpg",
"bounding-box": {
"image_size": [
{
"width": 1440,
"height": 1958,
"depth": 3
}
],
"annotations": [
{
"class_id": 0,
"top": 202,
"left": 277,
"width": 708,
"height": 950
}
]
},
]
Thank's for help