"jsondecode" poor performance in COCO datasets?

1 visualización (últimos 30 días)
cui,xingxing
cui,xingxing el 5 de Ag. de 2021
Comentada: Rik el 5 de Ag. de 2021
I tried to import data annotation files from COCO2017 and it takes about half a minute using “jsondecode”, while coco-api only takes about 15 seconds, can the performance of “jsondecode” be significantly provided in future versions?
Run R2021a,
cocoDir = 'coco2017/';
annFile = 'annotations_trainval2017\annotations\instances_train2017.json';
annFile = fullfile(cocoDir,annFile);
data = fileread(annFile);
tic
data = jsondecode(data);
toc
Elapsed time is 31.671089 seconds.
cocoDir = 'coco2017/';
annFile = 'annotations_trainval2017\annotations\instances_train2017.json';
annFile = fullfile(cocoDir,annFile);
tic
coco=CocoApi(annFile);
toc
Elapsed time is 15.598371 seconds.
  1 comentario
Rik
Rik el 5 de Ag. de 2021
Performance is strongly dependent on the implementation or the JSON parser. In the performance section (direct link, might break after an update) of the documentation for my JSON parser you can see there is a quite a wide margin.
For a very large file jsondecode is much faster (1000x), while for many small files my parser is faster (2-3x).

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by