'Extract Subset from Dataset

how can i extract a specific subset from a large dataset ?

Let's say i'll be using one of the open image Datasets which has: Train/Test/Validation Images and then the Labels File. It can be ".txt" or ".json" File. Let's say i'll be using the KITTI-Dataset or "nuScenes". Is there a code with which i can have only the Images where there is a "tree" for example ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source