# Import existing data

# Supported data formats

All data formats used by Imagimob AI follows open standards.

# Data files (.csv/.data)

The .data files are regular comma-separated ',' csv-files, with '.data' file extension and some additional requirements:

  • They always have a header, with or without '#' at the beginning of the line.
  • All floating point numbers must use '.' decimal points.
  • They always have a timstamp column, with time values strictly increasing.
  • They always use ',' as field delimiter.
  • They are always UTF8, no BOM.

This format is used to store timeseries data, ready to be used as input to an AI model. (Note that files with a '.csv' extension fulfilling these requirements are valid.)

Below is an example of a .data file containing samples from a 3-axis accelerometer.

# Format (data files)

Time column Data dimension 0 Data dimension N
floating point number floating point number floating point number

# Example data file contents

Time (seconds),X,Y,Z

# Converting data files to correct format using scripts

If you have data that is in a different format you can easily convert the data into the correct format using a python script. Here is an example of how to convert timestamps to the studio format using a script available in our public library Imagutils. You can find the script here (opens new window) Note that this script can easily be extended to do other conversions needed for your existing data. Information about extending the script can be found inside the script.

We have a file called 'output_chunk_1.csv' that you can see below, it's in CSV format but we want to convert the time format to a format that is supported in Imagimob Studio.

dd/mm/yyyy, hh:mm:ss.ms,    gyroX[mdps],    gyroY[mdps],    gyroZ[mdps],    accX[mg],   accY[mg],   accZ[mg]
01/01/2000, 00:08:31.679,   0,              -17,            -17,            1007,       -39,        -160
01/01/2000, 00:08:31.688,   -74497,         -30100,         -89722,         1007,       -39,        -160
01/01/2000, 00:08:31.729,   -70,            -367,           -105,           1007,       -35,        -156
01/01/2000, 00:08:31.769,   -140,           -507,           -210,           1018,       -46,        -152
01/01/2000, 00:08:31.809,   -70,            -525,           -245,           1003,       -35,        -152

If you have installed the library Imagiutils then you can use that library to convert the data to a correct format. To do this by calling the python script:

'$ python -m imagutil.scripts.convert_timestamps -i {Input path} -o {Output path} -f {Format standard of input}.' 
Here is an explanation about each argument: '-i INPUT, --input INPUT' : Path to input file to convert. '-o OUTPUT, --output OUTPUT' : Path to output file. '-f {stbox}, --format {stbox}' : Format standard of input timestamps.

After running the python script with the correct arguments we get a new file that looks like this:

Time (seconds),     gyroX[mdps],    gyroY[mdps],    gyroZ[mdps],    accX[mg],   accY[mg],   accZ[mg]
946685311.679,      0,              -17,            -17,            1007,       -39,        -160
946685311.688,      -74497,         -30100,         -89722,         1007,       -39,        -160
946685311.729,      -70,            -367,           -105,           1007,       -35,        -156
946685311.7689999,  -140,           -507,           -210,           1018,       -46,        -152
946685311.8089999,  -70,            -525,           -245,           1003,       -35,        -152

This new file will be possible to import into Imagimob Studio as described later in this guide.

# Label files (.csv/.label)

The .label files are regular comma-separated ',' csv-files, with '.label' file extension. This format is used to store labels, ready to be used as input to an AI model. Below is an example of a .label file. The same requirements as for the .data files hold for the .label files. Also, the confidence values must be in range [0.0, 1.0].

# Format (label files)

Time column Length dimension Label Confidence Comment
floating point number floating point number string floating point number string

# Example label file contents

3.132,4.962,walking,1.0,my comment

# Import data into Imagimob Studio

Imagimob Studio has a built in tool that allows you to import data. In this section this process is described. To import data, two requirements have to be met. The data has to be of the right format and in the right folder structure.

# Folder structure

To import data into Imagimob Studio, each recording/session has to be placed in an individual folder. Each recording can contain any number of data/video/label tracks. In the example each recording folder contains two data tracks (.data), one label track (.label) and one video track (.mp4).

Fig. Folder structure

Limitations: Recording sessions/folders must not contain sub folders that are in turn recording sessions/folders.

Once you have organized your recording sessions into individual folders you can import these sessions using the "Timeline Batch Import" tool as seen below by right-clicking the root folder containing all your recording sessions and selecting Tools -> Session Batch Import...

Fig. Session batch import

The Batch Import tool searches through your folders and recognize folders containing .data, .label or .mp4 files. The tool gives you an overview of what can be imported and allows you to select/deselect what to import.

When you are happy with your selection press OK.

Note: Your local folder structure and file/session names might differ from this example

Fig. View showing what will be imported

A dialog shows up confirming that the importing is done. If you import a lot of data this might take a while.

Fig. Import done.

After the import a .imsession file is present in each recording session/folder.

Fig. .imsession files was created for each recording session

Double click it to open your recording session and investigate your data/labels/video-tracks.

Fig. An open session