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 |
...
|
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.
docu.api.das-element.com
How To machine learning prediction
Simple usage
Code Block | ||
---|---|---|
| ||
das-element-cli.exe {file} |
Code Block | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
das-element-cli.exe predict {file1} {file2} {file3} |
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
das-element-cli.exe --info |
key | description |
---|---|
| the identifier for the class from Wikidata |
| meaningful readable tag |
| a list of different words for this class |
Result Format
For each file path you get a list of predictions for tags.
...
Code Block | ||
---|---|---|
| ||
{'/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 |
---|---|
| identifier value - see here for more details |
| human readable text of this category |
| description text for this category |
| 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 |
---|
| Shows information of the software. | ||
| Get the top X predictions of tags.
| ||
| File path to another model file (.wit) | ||
| Set the number of frames of a filmstrip for a sequence of images or movie files.
|
--debug
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. |
Windows startup is quite slow | Unfortunately that is an issue with Window that can not be fixed in the current moment. |