Skip to content

Latest commit

 

History

History
90 lines (76 loc) · 3.62 KB

File metadata and controls

90 lines (76 loc) · 3.62 KB

Client Usage of the Tagger API

Prerequisites

  • To use the Tagger API, the client needs a configuration file <config> with appropriate URLs and a private key, e.g.
{
  "space_id": "ispc3ANoVSzNA3P6t7abLR69ho5YPPZU",
  "api" : {"url": "http://192.168.90.214"},
  "fs": "os",
  "ethereum": {
    "url": "http://192.168.90.214/eth/",
    "private_key" : "0xxxx"
  },
  "log": {
    "level": "warn",
    "formatter": "console",
    "named": {
      "/cli": {
        "level": "warn",
        "formatter": "console"
      },
      "/cli-result": {
        "level": "normal",
        "formatter": ""
      }
    }
  },
  "silence_error": false
}
  • elv on Mac (or qfab_cli on Linux), getopt, jq, and curl
brew tap eluv-io/eluv-io
brew install elv jq curl gnu-getopt
  • <object id> and <library id>

Usage of the tag-cli

Usage: ./bin/tag-cli [command] [flags]
Available commands:
    tag                   Invoke a tagging process
    status                Check the status of a tagging process
    stop                  Stop a tagging process
    finalize              Finalize the content object with tag files/links uploaded
Flags:
    library_id            Library id of the content object (form of ilib*)
    object_id             Object id of the content object (form of iq__*)
    write_token           Write token for editing the content (form of tqw_*)
    --config              Client configuration for fabric networks
    --lro_handle          LRO handle returned by the tagging process
    -c, --container_id    Container index to run the tagger, [0, 1, 2]
    -s, --start_time      Start time of the video to run the tagger
    -e, --end_time        End time of the video to run the tagger
    -i, --interval        Time interval, multiple of which one tagging process aims for
    -f, --features        Machine learning features to tag, options ["celeb", "ocr", "od", "landmark", "action", "segment", "logo"]
Examples:
    ./bin/tag-cli tag ilibDeKuaKj1uzr5kq4mjWtsFzcihmQ iq__fanWxYmdrFfivQsViDoqrV9kgQV -c 0 -s 20 -e 39 -i 10 -f "od" --config config.json
    ./bin/tag-cli stop ilibDeKuaKj1uzr5kq4mjWtsFzcihmQ iq__fanWxYmdrFfivQsViDoqrV9kgQV -c 0 --config config.json
    ./bin/tag-cli status ilibDeKuaKj1uzr5kq4mjWtsFzcihmQ iq__fanWxYmdrFfivQsViDoqrV9kgQV -c 0 --config config.json --lro_handle "662291b5-c093-4302-9962-1207fb238299"
    ./bin/tag-cli finalize ilibDeKuaKj1uzr5kq4mjWtsFzcihmQ iq__fanWxYmdrFfivQsViDoqrV9kgQV tqw_8uHxaEot6ESoyuHxsFMvdhagHUByBwqrY --config config.json
  • Invoke the tagging process with <config>, <library id>, and <object id>. IDs can be extracted from the fabric browser. The tag command produces a <wrote_token> and a <lro_handle>, which are required for the status check and content finalize, respectively.
 ./bin/tag-cli tag <library id> <object id> -c <container id> -s <start time> -e <end time> -i <interval> -f <features> --config <config>
  • Early stop the tagging process if needed.
./bin/tag-cli stop <library id> <object id> -c <container id> --config <config>
  • Check the status of the tagging process using "lro_handle" generated by the "tag" command. One needs to verify if the tagging process is "finished" before "finalize" the content on the fabric.
./bin/tag-cli status <library id> <object id> -c <container id> --config <config> --lro_handle <lro handle>
  • Finalize the content if everything looks good. It will publish tags on the fabric, which one can visualize on the video editor.
./bin/tag-cli finalize <library id> <object id> <write token> --config <config>