shy-credit-test
v0.6.5-rc0
Published
[![npm version](https://img.shields.io/npm/v/shy-credit-test.svg?style=flat-square)](https://www.npmjs.org/package/shy-credit-test) [![npm downloads](https://img.shields.io/npm/dm/shy-credit-test.svg?style=flat-square)](http://npm-stat.com/charts.html?pac
Downloads
28
Readme
shy-credit
Suite JSON handler module
- LabelResultDef: Former project.label_interface
- LabelResult: Former label.info.result
Getting Started
Install
Using npm:
$ npm i shy-credit-test
Build your own project with shy-credit
create new project:
$ npm init
$ npm i shy-credit-test
$ node index.js
index.js:
const ShyCredit = require("shy-credit-test").default;
// Validate legacy label interface and generate summary
const legacyLabelInterface = {...};
// This will throw error if label interface is invalid
const labelResultDef = ShyCredit.Image.LabelResultDef.createFromLegacy(legacyLabelInterface);
const labelResultDefSummary = labelResultDef.summarizeToJSON();
// Validate legacy label result and generate tags
const legacyLabelResult = {...};
// This will throw error if label result is invalid
const labelResult = ShyCredit.Image.LabelResult.createFromLegacy(legacyLabelResult);
const labelResultTags = labelResult.generateTags();
// Build label interface from scratch
const newLabelResultDef = new ShyCredit.Image.LabelResultDef({
type: 'legacyImage', // legacy type is supported only for now
dataType: 'image',
... // Check documentations for detail
});
console.log(newLabelResultDef.toJSON());
How to use
LabelResultDef
- What is it
- Previously project.label_interface
- Contains information about how to label (classes, properties)
- When to use this module
- Validate plain JSON label_interface value
- Generate summary for overview
- Create new label interface with constructor functions
- Get informations like keypoint templates, AI engines and autolabel-able classes
- TODO
- Create new object with YAML settings
- Further considerations
- Add versioning
- Currently there's no version and only legacy image type is supported
- Legacy image still follows "any" in typescript. It'd be better to define types.
- Add versioning
LabelResult
- What is it
- Previously label.info.result
- Contains labeled result
- When to use this module
- Validate plain JSON label result
- Generate "tags" from result
- TODO
- More detailed validation
Running the tests
Run test codes
$ git clone https://github.com/Superb-AI-Suite/shy-credit.git
$ cd shy-credit
$ npm i
$ npm run test
Build & Publish Project
Publish in NPM
$ git clone https://github.com/Superb-AI-Suite/shy-credit.git
$ cd shy-credit
$ npm i
$ # Do the job
$ # Don't forget to run test and change version in package.json before publish
$ # also index.ts
$ npm run build
$ npm publish
Build Docs
$ npm i typedoc --global
$ typedoc docs src/
TODO
- Add Documentations for each Classes
Semver
Until shy-credit reaches a 1.0
release, breaking changes will be released with a new minor version.
Authors
Contact [email protected]