Skip to content

Stores and files structure

Nachem Rosenberg edited this page Oct 26, 2023 · 2 revisions

File Types

The Statistic tool operates with three types of files: prediction log files, annotation files, and data files. The data files currently consist of either videos or images and are grouped into three "Stores": Prediction, Annotation, and Data. The stores can be either folders on a local machine or a folder prefix in cloud storage, with only Azure Storage being supported at present. In the configuration file, the location information for each store can be set.

Prediction Store

The Prediction Store contains log files from any stage of the algorithm. These files are compared to the matched annotation file.

Annotation Store

The Annotation Store contains the annotation data used to compare with the data in the prediction files.

Data Store

The Data Store includes images related to the prediction. The matching between each prediction and the corresponding image (which can be a video or image file) can be done in the user-defined "reading" function or according to the file structure.

File Structure

The data can be ordered in the stores in files that include batches of predictions and annotations (e.g. file for each video) or in folders that include batches of files. The folders should be ordered in the same way in all the stores. The StatisticsTool will evaluate the data by batches, batch in folder, or in file according to the user's choice.

Video Name

Prediction data should have corresponding annotation data and can have corresponding image or video data. The data can be grouped into different log files or different log folders. Each group of data (file or folder) has a common name called "video_name". The common name helps the StatisticsTool match between the prediction, annotation, and the images. The "video_name" is the path to a folder or a file in the stores.

The StatisticsTool has a few ways to get the video_name from the prediction file:

  • Header in prediction files: The StatisticsTool checks whether there is a header with a specific format in the prediction file. The header should be in the first line of the prediction log file, and it should be a JSON line with the following format: {"header":"video_file_name":<VIDEO_NAME>}
  • If there is no header, the StatisticsTool sets "video_name" to be the path to the prediction file/folder in the Predictions Store, not including file name.

Match Prediction and Annotation

After the StatisticsTool finds "video_name" as described above, it looks for the Annotation file in the Annotation Store. The annotation file should be in the same path as the video_name and can be one of the following:

  1. File with the same name as the video_name with the same extension as the prediction file. For example, if the video name is "test1/type1", the annotation file could be "test1/type1.json".
  2. File with the same name and path as the prediction file, but in the Annotation Store.
  3. Folder with the path as video_name.

Example

Suppose the prediction file is located at "PATH_TO_PREDICTION_STORE/test1/type1/log.json". In this case, the video name will be "test1/type1". The annotation file may be one of the following:

  1. "ANNOTATION_FILE_STORE/test1/type1.json"
  2. "ANNOTATION_FILE_STORE/test1/type1/log.json"
  3. "ANNOTATION_FILE_STORE/test1/type1" if the predictions batches are folders.

I hope this helps! Let me know if you need any further assistance.

Clone this wiki locally