Deepomatic Platform
v2.4.3
Search
K
Comment on page

Deepomatic CLI import txt file

Import file format

Uploading images with a text file is the recommended solution if you need to add a large number of images.

File structure

The text file contains a set of JSON objects:
  • the first object is a header allowing you to define the tree structure of the views composing your project
  • the other objects correspond to all the images you wish to import, one per image.
This structure allows the upload of very large quantities of data by streaming.
The header is a JSON object that allows you to define your views and the concepts attached to each of them. It is also in the header that you indicate the tree structure of your views, and how the child and parent views are linked together.
Header json
{
"name": "Bulk items",
"splits": [
"train",
"val"
],
"views": [
{
"concepts": [
{
"name": "With Item"
},
{
"name": "Without Item"
}
],
"type": "classification",
"name": "Item or not",
"conditions": []
},
{
"concepts": [
{
"name": "Item"
}
],
"type": "detection",
"name": "Item Detector",
"conditions": [
[
{
"name": "With Item"
}
]
]
},
{
"concepts": [
{
"name": "Glass"
},
{
"name": "Metal"
},
{
"name": "Wood"
}
],
"type": "classification",
"name": "Item material",
"conditions": [
[
{
"name": "Item"
}
]
]
}
]
}
Here are the fields you need to specify:
  • name : the name of your project
  • splits : a list which only supports train and val for now.
  • views : each entry in the views list defines a view and contains the following fields:
    • name : the name of your view
    • type : the type of your view among classification, tagging or detection (see the creation of views to know more)
    • concepts : each entry in the concepts list defines a concept and contains the following field:
      • name: the name of your concept.
    • conditions : a list of lists of concepts to specify AND and OR conditions. A list of concepts specifies a AND condition and the list of lists specifies OR conditions.
Concepts must be unique within a project. It is not possible to have several concepts with the same name in separate views.
The header in your file should be on a single line and will allow the platform to build all the views and all the concepts that you have specified, based on the conditions you have indicated.

Images

Each image you want to add to your project is a JSON object that must be written on a single line of your file.
Image
{
"id": null,
"data": [
{
"file": "/path"
}
],
"metadata": "{}",
"annotations": [
{
"concepts": [
{
"name": "Glass",
"bool": true
},
{
"name": "Item",
"bool": true
}
],
"region": {
"bbox": {
"xmin": 0.14237532448083068,
"ymin": 0.2097216707202064,
"xmax": 0.7449424670527156,
"ymax": 0.9198461929815852
}
}
},
{
"concepts": [
{
"name": "With Item",
"bool": true
}
],
"region": {
"bbox": {
"xmin": 0.0,
"ymin": 0.0,
"xmax": 1.0,
"ymax": 1.0
}
}
}
],
"splits": [
"train"
]
}
Here are the fields you need to specify:
  • id : null
  • data : each entry in the data list is an object that contains the field file that you need to specify. ⚠️ As your images are stored locally specify the path to the image using the file key.
  • metadata : a string of characters via which you can add metadata to your image as a dictionary. The metadata are displayed in the information popup on Studio.
Some data are automatically added to the platform: File name, Created, Creator and Last annotator are set automatically.
  • annotations: each entry in the annotations list corresponds to a region, with all the information attached to it:
    • concepts: the list of concepts attached to the region. You should not create an annotation for each view, but instead you need to combine the concepts from all the views required in a single annotation.
    • region: the actual region, described as a bounding box bbox, and the coordinates of this bounding box, xmin, ymin, xmax and ymax.
  • splits: a list of splits to which the image belongs. You should choose between train and val for now.
The difference between classification and tagging views is that for classification views, the annotation can only have one of the concept with bool field at True.