"jsondecode" poor performance in COCO datasets?

3 Ansichten (letzte 30 Tage)
cui,xingxing
cui,xingxing am 5 Aug. 2021
Kommentiert: Rik am 5 Aug. 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 Kommentar
Rik
Rik am 5 Aug. 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).

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by