Dataset partition mode: sequence

Hi, I’m training detectnet_v2 in order to recognize vehicle.

My dataset comes from some video that have been labeled. When I do the partition I do not want the random mode, else in test part there can be a vehicle already known from a precedent videoframe. I have to split the 6 minutes video into something like: 5 min for train, discard 15 sec for better separation, keep the last 45 sec for test.

I know that sequence mode requires a particular file, kitti_sequence_to_frames_file, but I didn’t find any documentation about how to configure it.

I tried something like this with tfrecord specs, one for train one for test:

kitti_config {
  root_directory_path: "/workspace/tlt-experiments/210825/data/train"
  image_dir_name: "images"
  label_dir_name: "labels"
  image_extension: ".png"
  partition_mode: "sequence" # it needs kitti_sequence_to_frames_file
  # partition_mode: "random"
  num_partitions: 1 # use 2 to create train-valid partition. 
  val_split: 10
  num_shards: 10
  kitti_sequence_to_frames_file: "kstff.txt"
}
# For most cases, this will be the same as the root_directory_path. If
# for some reason the images are in a different directory, then 
# the images will be dereferenced as
# image_directory_path/image_dir_name/<xxxx><image_extension>
image_directory_path: "/workspace/tlt-experiments/210825/data/train"

my directory is:

data - train  - images
              - labels
              - kstff.txt
     - test   - images
              - labels
              - kstff.txt

kstff.txt contains just the fake string: “What do you need here?” Where can I find how to configure it?

The command is:

# Creating a new directory for the output tfrecords dump.
print("Converting Tfrecords for kitti trainval dataset")
!tlt-dataset-convert -d $SPECS_DIR/detectnet_v2_tfrecords_kitti_trainval_1.txt \
                     -o $DATA_DOWNLOAD_DIR/tfrecords/kitti_trainval_1/kitti_trainval

The output is:

Converting Tfrecords for kitti trainval dataset
2021-09-03 08:51:55.491859: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0
Using TensorFlow backend.
2021-09-03 08:51:57,493 - iva.detectnet_v2.dataio.build_converter - INFO - Instantiating a kitti converter
Traceback (most recent call last):
  File "/usr/local/bin/tlt-dataset-convert", line 8, in <module>
    sys.exit(main())
  File "/home/vpraveen/.cache/dazel/_dazel_vpraveen/715c8bafe7816f3bb6f309cd506049bb/execroot/ai_infra/bazel-out/k8-py3-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/detectnet_v2/scripts/dataset_convert.py", line 63, in main
  File "/home/vpraveen/.cache/dazel/_dazel_vpraveen/715c8bafe7816f3bb6f309cd506049bb/execroot/ai_infra/bazel-out/k8-py3-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/detectnet_v2/dataio/build_converter.py", line 76, in build_converter
  File "/home/vpraveen/.cache/dazel/_dazel_vpraveen/715c8bafe7816f3bb6f309cd506049bb/execroot/ai_infra/bazel-out/k8-py3-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/detectnet_v2/dataio/kitti_converter_lib.py", line 101, in __init__
  File "/home/vpraveen/.cache/dazel/_dazel_vpraveen/715c8bafe7816f3bb6f309cd506049bb/execroot/ai_infra/bazel-out/k8-py3-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/detectnet_v2/dataio/kitti_converter_lib.py", line 199, in _read_sequence_to_frames_file
  File "/usr/lib/python3.6/json/__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Thanks for any help!

Please refer to Data Annotation Format — TAO Toolkit 3.0 documentation and Data Annotation Format — TAO Toolkit 3.0 documentation