cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
11.74k stars 2.88k forks source link

Task Annotations Export API for Datumaro 1.0 Fails on V2.14.3 but works on V2.14.0 #8041

Closed PrithiPal closed 1 week ago

PrithiPal commented 1 week ago

Actions before raising this issue

Steps to Reproduce

Overview Using API to export task level annotations not works on v2.14.3 but works on v2.14.0. I have not tested versions after 2.14.0 to find closest version which introduced this fault.

  1. Spin up v2.14.3 of CVAT services.
  2. Have a task with a job and some annotations in it ( more than 1 )
  3. Use API to export all annotations in the tasks using https://<url>/api/tasks/<TaskID>/annotations?action=download&format=Datumaro+1.0
  4. The request returns Bad Request 404. Below are the cvat_server logs
    2024-06-18 00:30:12,229 DEBG 'uvicorn-1' stdout output:
    INFO:     10.58.42.157:0 - "GET /api/tasks/449/annotations?format=Datumaro+1.0&action=download HTTP/1.0" 400 Bad Request
  5. But exporting task annotations from Export task annotations works, on the same task from CVAT UI. Here's the server output
    
    2024-06-18 00:29:29,240 DEBG 'uvicorn-1' stdout output:
    INFO:     10.58.42.1:0 - "GET /api/tasks/449/annotations?org=&use_default_location=true&format=Datumaro+1.0 HTTP/1.0" 201 Created

2024-06-18 00:29:29,423 DEBG 'uvicorn-1' stdout output: INFO: 10.58.42.1:0 - "GET /api/projects/186 HTTP/1.0" 200 OK

2024-06-18 00:29:29,443 DEBG 'uvicorn-0' stdout output: INFO: 10.58.42.1:0 - "GET /api/tasks/449/annotations?org=&use_default_location=true&format=Datumaro+1.0&action=download HTTP/1.0" 200 OK



I was able to run my unit-test with 2.14.0 and it passes the test.

### Expected Behavior

Should only send 400, in case whether task/annotation not exists. But returns 400, with 2 annotations. Ideally, first response should be 200 ( meaning task annotations export started ), and in subsequent requests should receive 202 ( meaning task exported ), and the raw binary will be response contents.

### Possible Solution

_No response_

### Context

_No response_

### Environment

_No response_
zhiltsov-max commented 1 week ago

Hi, calling the endpoint with the action=download parameter is only valid after it has been called without the parameter. Example.