NaturalIntelligence / NaturalIntelligence/imglab

Export to Pascal VOC faulty when based on imported data

Open
#190 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1k
Forks
613
PR merge metrics
No merged PRs in 30d

Description

If a dlib xml is imported and the data is exported as pascal VOC the xmax and ymax values are wrong. It seems like the additions in lines 38/39 of pascal_voc.js are receiving string values for shape.bbox.x and shape.bbox.w this leads to a string concatenation when an int addition is intended.

To Reproduce
Steps to reproduce the behavior:

  1. import data in dlib xml format
  2. Click on save --> Pascal VOC XML
  3. See error in exported file

Quick fix by changing lines 38/39 of pascal_voc.js from

        <xmax>${shape.bbox.x + shape.bbox.w}</xmax>
        <ymax>${shape.bbox.y + shape.bbox.h}</ymax>

to

        <xmax>${parseInt(shape.bbox.x) + parseInt(shape.bbox.w)}</xmax>
        <ymax>${parseInt(shape.bbox.y) + parseInt(shape.bbox.h)}</ymax>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open pascal_voc.js and inspect lines 38/39, then reproduce the export after importing dlib XML data. Verify that the generated Pascal VOC XML contains numeric xmax and ymax values equal to the bounding-box coordinates plus dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.