cna74 / Basilia

object detection with tensorflow-keras based on Open-Image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basilia

An API for Open-Image-V4 to gather your desired images with bboxes in just TWO LINES OF CODE! open-image-v4-1024x655.png

Downloading DataSet

if you want to use online just download csv and json

└── 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

create environment [optional]

  • conda create -n ElBasil python=3.6
  • source activate ElBasil

clone Basilia

  • clone repo git clone https://github.com/cna74/Basilia.git
  • install requirements pip install -r Basilia/requirements.txt

install object-detection-api

  • 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

edit config.py file

  • 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)

    Punching-bag.png

    from Basil import Finder
    # find fox, tiger and jaguar
    Finder(subject=("fox", "tiger", "Jaguar"), out_dir="/home/cna/Desktop/", automate=True)

    Animal.png

    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

Tutorial

part 1

Basilia part 1

part 2

Basilia part 2

About

object detection with tensorflow-keras based on Open-Image

License:MIT License


Languages

Language:Jupyter Notebook 99.8%Language:Python 0.2%