Closed TimotheeWrightFicha closed 1 week ago
Duplicate of #https://github.com/cvat-ai/cvat/issues/8041
Short answer: add action=download
only when server returned code 201
Hello @bsekachev I think so CVAT SDK is not supporting this behaviour , it does not allow action values to be set other than "download" .
api_client.tasks_api.retrieve_dataset( id=task_id, format="COCO 1.0", action="download", location="local", _parse_response=False, )
So we have to manually write request to download dataset. Can you please correct me if I am wrong?
`
while True:
try:
response = re.get(url, auth=('**', '**'))
print(response.status_code)
if response.status_code == 202:
print("Dataset is being prepared.")
continue
elif response.status_code == 201:
url = url + "&action=download"
print("File path has been created.")
elif response.status_code == 200:
data_name = f'Data_{task_id}_{datetime.now().strftime("%Y_%m_%d_%H_%M")}.zip'
print(data_name)
with open(data_name, "wb") as output_file:
output_file.write(response.content)
break
else:
print(f"An error occurred: {response.status_code}")
error = True
break
except Exception as e:
print(f"An error occurred: {e}")
error = True
break
`
it does not allow action values to be set other than "download" .
Try to omit this parameter, you do not need to specify other values.
Actions before raising this issue
Steps to Reproduce
Got the error:
Expected Behavior
The same code used to work to export data out of CVAT.
Possible Solution
I saw this commit linked to download of dataset was done since the last time we run our code. Maybe it's coming from there ?
Context
Trying to export tasks from CVAT from python
Environment
No response