Inferencing over several datasets with one specs file?

I am wondering whether it is possible to apply inferencing on several datasets with one specs file. It’s a bit annoying to turn on a docker at each time (3 minutes for startup) for a couple of minutes of inferencing. Putting all data in the same folder is not an option as it really mixes up things for me, especially naming the outputs.

inference_config {
images_dir: '/workspace/tao-experiments/data/training/Lightly/testing/image_2'
batch_size: 1
bbox_caption_on: True
detection_image_output_dir: '/workspace/inf/inference_results_imgs'
labels_dump_dir: '/workspace/inf/inference_dump_labels'
rpn_pre_nms_top_N: 6000
rpn_nms_max_boxes: 300
rpn_nms_overlap_threshold: 0.9
object_confidence_thres: 0.0001 #0.0001
bbox_visualize_threshold: 0.6
classifier_nms_max_boxes: 100
classifier_nms_overlap_threshold: 0.0001
}

I am using a FasterRCNN.

For instance, is it possible to have two inference_config entries? or several image_dir, detection_image_output_dir and labels_dump_dir in one entry?

Best

Currently, the Faster_rcnn inference script can support one folder only.
For this feature, you can try to modify the code(https://github.com/NVIDIA/tao_tensorflow1_backend/blob/c7a3926ddddf3911842e057620bceb45bb5303cc/nvidia_tao_tf1/cv/faster_rcnn/scripts/inference.py.) to meet expectation.
Assume there are below structure,

Folder
|------subfolder_1
|------subfolder_2

You can change line 128 to

128  folder_path = spec.inference_images_dir

And also add a logic on the top of https://github.com/NVIDIA/tao_tensorflow1_backend/blob/c7a3926ddddf3911842e057620bceb45bb5303cc/nvidia_tao_tf1/cv/faster_rcnn/scripts/inference.py#L201-L299.
For example,

folder_set = os.listdir(folder_path)
for subfolder in folder_set:
    if os.path.isdir(os.path.join(folder_path, subfolder)):
        img_path = os.path.join(folder_path, subfolder)
        image_set = os.listdir(img_path)
        ...

You can also need to handle https://github.com/NVIDIA/tao_tensorflow1_backend/blob/c7a3926ddddf3911842e057620bceb45bb5303cc/nvidia_tao_tf1/cv/faster_rcnn/spec_loader/spec_wrapper.py#L514-L522 and output dirs(https://github.com/NVIDIA/tao_tensorflow1_backend/blob/c7a3926ddddf3911842e057620bceb45bb5303cc/nvidia_tao_tf1/cv/faster_rcnn/scripts/inference.py#L295C37-L297).

Thanks for your input Morgan :). Appreciate it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.