admin管理员组

文章数量:1399881

I downloaded the annotation from the video in CVAT. I want to import this annotation to another video. When I import it via ui, there are no problems. But when I import via API, I get an error: "JSON parse error - Expecting value: line 1 column 1 (char 0)". Here is my code

TOKEN = 'my_token'
task_id = 'my_task_id'


url = f'{HOST}/api/tasks/{task_id}/annotations/'

file_path = "default.json"

headers = {
    "Authorization": f"Token {TOKEN}",
    "Content-Type": "application/json"
}

params = {
    "format": "Datumaro 1.0", 
    "location": "local"   
}


with open(file_path, "rb") as file:
    data = file.read()
    files = {"annotation_file": data}
    response = requests.post(url, headers=headers, params=params, files=files)

I tried to pass json in different ways, but without success

本文标签: Can not import task annotation in CVAT using APIStack Overflow