NaturalIntelligence / imglab

To speedup and simplify image labeling/ annotation process with multiple supported formats.
https://solothought.com/imglab/
MIT License
977 stars 596 forks source link

Fix toCOCO bbox returning undefined #123

Closed jbovee closed 5 years ago

jbovee commented 5 years ago

Purpose / Goal

Fix an error in toCOCO in coco.js causing the bbox property in the resulting COCO formatted data/file to always have a value of undefined.

Cause

shape_i.bbox is used to try and get the bbox value for the current shape in the for loop. shape_i is just the iteration counter though, and has no such property.

Solution

Change shape_i to shape, referencing the shape object retrieved at the beginning of the for loop.

Type

Please mention the type of PR

Note : Please ensure that you've read contribution guidelines before raising this PR.