Giter Site home page Giter Site logo

Comments (3)

lirsacc avatar lirsacc commented on August 22, 2024

@jabooth Is maintaining the order of keys as specified in the file important ? As order should not matter in yaml files order is not guaranteed by the PyYAML parser but it could be handled if needed.

Otherwise previous commits parses templates like :

mouth:
  points: 6
nose:
  points: 3
  connectivity:
    - 0 1
    - 1 2
left_eye:
  points: 8
  connectivity:
    - 0:7
    - 7 0
right_eye:
  points: 8
  connectivity: cycle
chin: 1

to the same json as the text files (without the same order)

from landmarkerio-server.

jabooth avatar jabooth commented on August 22, 2024

@lirsacc Unfortunately order is important - this is because landmarks can always be interpreted as a single large (ordered) point collection, or single ordered groups.

I believe we moved the an array in LJSON format 2 from keys so we had a guarantee of maintaining key order. Perhaps we should use an array in YAML template too to definite the different groups?

from landmarkerio-server.

lirsacc avatar lirsacc commented on August 22, 2024

Yep, simple array should work with something like:

groups:
  - label: mouth
    points: 6
  - label: nose
    points: 3
    connectivity:
      - 0 1
      - 1 2
  - label: left_eye
    points: 8
    connectivity:
      - 0:7
      - 7 0
  - label: right_eye
    points: 8
    connectivity: cycle
  - label: chin
    points: 1

Would also make it simpler to add metadata aside the actual template (ignored now but tracking an update date to compare with ljson file could have it's use for versioning schemas)

I have updated my branch and it consistently gives the same json output as the old text file.

from landmarkerio-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.