Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This is the command line tool from das-element for .

It contains the API (supporting Python 2 & 3) and the classification of image, sequence and movie files.

Tip

You can deploy it on your render farm to use it in a post-render process for tagging of elements

Info

Each version will be shipped with the model inside. Use the --info flag to get the version number

Versions

There are two command line tool (CLI) versions with a different range of features and file size.

cli

This version is optimized to receive data from the database or update an element.
Smaller in file size and fast to use, but has a reduced set of features.

Code Block
  get-categories                 Get all categories of the library
  get-category                   Get category entity
  get-element-by-id              Get element entity from element ID
  get-element-by-name            Get element entity from element name
  get-element-by-uuid            Get element entity from element UUID
  get-elements                   Get all elements of the library
  get-libraries                  Get all libraries data for current config
  get-library-template-mappings  Get all library template mappings
  get-tag                        Get tag entity
  get-tags                       Get all tags of the library
  license                        Show license
  update                         Updates database entity

cli_full

Includes all features of the CLI, like ingesting files, rendering proxies or running a machine learning model.
This version has larger in file size and is slower.

Code Block
  delete-element                 Delete element
  get-categories                 Get all categories of the library
  get-category                   Get category entity
  get-element-by-id              Get element entity from element ID
  get-element-by-name            Get element entity from element name
  get-element-by-uuid            Get element entity from element UUID
  get-elements                   Get all elements of the library
  get-libraries                  Get all libraries data for current config
  get-library-template-mappings  Get all library template mappings
  get-meaningful-frame           Validate meaningful thumbnail frame number
  get-paths-from-disk            Get all file paths from a given folder.
  get-tag                        Get tag entity
  get-tags                       Get all tags of the library
  info                           Show machine learning model info
  ingest                         Ingest new element
  license                        Show license
  predict                        Predict the category for a give file path.
  render-element-proxies         Render the proxy files for an element...
  update                         Updates database entity

...

Installation

Save the software to your preferred location. That’s all!

On Linux make sure to run this command to make the file executable:

Code Block
chmod +x das-element-cli_{version}_lin

API

To learn more about the application programming interface (API) follow this link here.

Documentation

docu.api.das-element.com

Python API

https://github.com/das-element/python-api

How To machine learning prediction

Info

Each version will be shipped with the model inside. Use the info flag to get the version number

Simple usage

Code Block
languagebash
das-element-cli.exe {file}
Code Block
languagebash
# Linux & Mac
das-element-cli predict /path/to/file.#.exr

# Windows
C:\das-element-cli.exe predict C:\path\to\file.#.exr

# result:
{"/path/to/file.#.exr": [{"tag": "fire", "description": "rapid oxidation of a material", "value": "Q3196"}]}

...

Code Block
languagebash
das-element-cli.exe predict {file1} {file2} {file3}
Code Block
languagebash
das-element-cli.exe predict /path/to/files.#.exr /path/to/another/file.mov

# result:
{"/path/to/files.#.exr": [{"tag": "fire", "description": "rapid oxidation of a material", "value": "Q3196"}],
"/path/to/another/file.mov": [{"tag": "torch", "description": "stick with a flaming end used as a source of light", "value": "Q327954"}]}

...

Code Block
languagepowershell
das-element-cli.exe predict --top 3 /path/to/file.mov

# result:
{"/path/to/file.mov": [
      {"tag": "torch", "description": "stick with a flaming end used as a source of light", "value": "Q327954"},
      {"tag": "fire", "description": "rapid oxidation of a material", "value": "Q3196"},
      {"tag": "flame", "description": "visible, gaseous part of a fire", "value": "Q235544"}
]}

...

Code Block
languagepy
# print the top 3 tag predictions for a given file path

import json
import subprocess

path = '/path/to/file.mov'
command = ['./das-element-cli.exe', 'predict', '--top', '3', path]
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()

if process.returncode != 0:
    print('Something went wrong: {} - Error: {}'.format(path, error))
else:
    result = json.loads(output)
    for path, predictions in result.items():
        wikidata_ids = [item['value'] for item in  predictions]  # list of IDs from wikidata
        readable_tags = [item['tag'] for item in predictions]  # list of human readable tags
        print('For path: "{}" predicted the tags {}'.format(path, ', '.join(readable_tags)))

# result:
# For path: "/path/to/file.mov" predicted the tags: torch, flame, fire

...

Code Block
languagebash
das-element-cli.exe --info

key

description

id

the identifier for the class from Wikidata

human-readable

meaningful readable tag

synonym

a list of different words for this class


Result Format

For each file path you get a list of predictions for tags.

...

Code Block
languagejson
{'/path/to/file.mov': [{
                          'value': 'Q327954',
                          'tag': 'torch',
                          'description': 'stick with a flaming end used as a source of light'
                          'parents': "parents": [{'id': 'Q3196', 'name': 'fire'}, {'id': 'Q235544', 'name': 'flame'}]
                        }]}

key

description

value

identifier value - see here for more details

tag

human readable text of this category

description

description text for this category

parents

the parent tags based on the category hierarchy structure

Flags for prediction

These are the flags that can be set for the prediction.

flag

description

--

info

Shows information of the software.
List all categories that this version of the model can classify.

predict --top {number}

Get the top X predictions of tags.

Info

The first two predictions are probably the most significant ones.

predict --model

File path to another model file (.wit)
Each version will be shipped with a model file inside the executable

predict --filmstrip_frames

Set the number of frames of a filmstrip for a sequence of images or movie files.
default value: 36

higher value: takes longer, but this might give you more different tags
lower value: faster, but might return less tags

Info

Example: for a sequence of 1000 frames only a number of frames get validated. This helps to speed up the process and still gets you a good result.

--debug

debugging mode

Troubleshooting

issue

solution

MacOS shows unidentified developer for 'ffprobe'

For MacOS you should add the ffprobe to your trusted applications if you want to use the software.

We use the ffmpeg and ffprobe build from MacOS from the following source: https://evermeet.cx/ffmpeg/

Windows startup is quite slow

Unfortunately that is an issue with Window that can not be fixed

in

at the

current

moment.