An API for Open-Image-V4 to gather your desired images with bboxes in just TWO LINES OF CODE!
if you want to use online just download csv and json
-
csv:
train-annotations-bbox.csv train-images-boxable.csv validation-annotations-bbox.csv validation-images.csv test-annotations-bbox.csv test-images.csv class-descriptions-boxable.csv json_hierarchy -
zip *: download zip file if you want to use basilia in offline mode
train_00 train_01 train_02 train_03 train_04 train_05 train_06 train_07 train_08 validation test download and extract them
-
store files like this, stared items are't necessary for online use
└── Open_Image
├── class-descriptions-boxable.csv
├── bbox_labels_600_hierarchy.json
├── Test
│ ├── test-annotations-bbox.csv
│ ├── test-images.csv
│ └── test *
├── Train
│ ├── train_00 *
│ ├── train_01 *
│ ├── train_02 *
│ ├── train_03 *
│ ├── train_04 *
│ ├── train_05 *
│ ├── train_06 *
│ ├── train_07 *
│ ├── train_08 *
│ ├── train-annotations-bbox.csv
│ └── train-images-boxable.csv
└── Validation
├── validation *
├── validation-annotations-bbox.csv
└── validation-images.csv
conda create -n ElBasil python=3.6
source activate ElBasil
- clone repo
git clone https://github.com/cna74/Basilia.git
- install requirements
pip install -r Basilia/requirements.txt
- clone repo
git clone https://github.com/tensorflow/models.git
- move to research directory
cd models/research/
- install object-detection-api
python3 setup.py install
-
open
Basilia/utils/config.py
DATA_DIR="<path-to-open-image-directory>" # if you downloaded zip files and extracted them RESOURCE="jpg" # if you just downloaded csv files RESOURCE="csv"
-
from directory
Basilia/
:from Basil import Finder # find Punching bags Finder(subject="Punching bag", out_dir="/home/cna/Desktop/", automate=True)
from Basil import Finder # find fox, tiger and jaguar Finder(subject=("fox", "tiger", "Jaguar"), out_dir="/home/cna/Desktop/", automate=True)
from Basil import Finder # just count all type of fruits, won't extract them Finder(subject="fruit", out_dir="/home/cna/Desktop/", just_count=True, automate=True) ''' just count images: Images Objects Train 13271 0 Validation 786 0 Test 2545 0 '''
more examples in https://github.com/cna74/Basilia/blob/master/Examples.ipynb