hans

hans

【Shell】Extract a specific class of images and annotation files from the ILSVRC_DET dataset.


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

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.