"jsondecode" poor performance in COCO datasets?

2 vues (au cours des 30 derniers jours)
cui,xingxing
cui,xingxing le 5 Août 2021
Commenté : Rik le 5 Août 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 commentaire
Rik
Rik le 5 Août 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).

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by