Recently, I have been studying the ILSVRC_DET dataset and wanted to train models that only detect certain specified categories. I wrote the following shell script to extract all images and annotation files related to the specified categories from the 2011-2014 competition train sets and val sets.
I am new to scripting and have been researching a lot online. I have found that the world of scripting is vast, with many different commands that can achieve the same effect. I am learning slowly.
There are many directory designs because it can greatly reduce the time used for recursive searching. Additionally, compressed files are placed in the corresponding subdirectories after being extracted. The above script is placed in the Home directory.
Below is the directory tree:
ImageNet -|
|- Home
|- ILSVRC2011 -|
| |- train -|
| | |- img
| | |- xml
| |- val -|
| |- img
| |- xml
|- ILSVRC2012 -|
| |- train -|
| | |- img
| | |- xml
| |- val -|
| |- img
| |- xml
|- ILSVRC2013 -|
| |- train -|
| | |- img
| | |- xml
| |- val -|
| |- img
| |- xml
|- ILSVRC2014 -|
| |- train -|
| | |- img
| | |- xml
| |- val -|
| |- img
| |- xml