Skip to main content

Image annotation file operation provider. [Documentation](https://imgann.readthedocs.io/en/latest/index.html)

Project description

Python library for annotation file conversion and preview.

Total Downloads     Build Status     Version

Installation

  1. From PiPy You can install the Real Python Feed Reader from PyPI:
$ pip install imgann

The package is support Python 3.7 and above.

  1. From github clone the codebase from GitHub
$ git clone https://github.com/nipdep/imgann.git

build the library

$ python setup.py bdist_wheel sdist

install built library

% for usual usage
$ pip install -e .
% for development 
$ pip install -e .[dev]

Official Documentation

ReadTheDocs link : https://imgann.readthedocs.io/en/latest/index.html

Usage

For functional usages in detail refer the documentation

  • To get N number of annotated images randomly. you can use coco format, pascalVOC format or csv format as annotation format. keywords can be from ['coco', 'csv', 'voc']
    from imgann import Sample
    Sample.show_samples( <image dataset dir> : string, <annotation file dit> : string, <number of images> : int, <annotation type> : string= 'coco', <center COCO> : bool= True )

    example :

    Sample.show_samples('./data/test','./annotations/test',5,'voc')
    
  • To convert annotation file format.

    • coco to pascal VOC format converting
      from imgann import Convertor
      Convertor.coco2voc( <image dataset dir> : string, <coco annotated .json file dir> : string, <voc formatted .xml file saving folder dir> : string, <center COCO> : bool= True) \

      note : if <center COCO> = True the generating bouding box format is [X_center, Y_center, Width, Heigth]
      <center COCO> = False then 'bbox' format of .json file is [X_min, Y_min, Width, Heigth] < roboflow annotated .json files saved in this format.

      example :

      Convertor.coco2voc('../data/train', '../data/annotations/dataset.json', '../data/annotations/voc_dataset')
      
    • coco to csv format converting
      from imgann import Convertor
      Convertor.coco2csv( <image dataset dir> : string, <coco annotated .json file dir> : string, <voc formatted .csv file dir> : string, <center COCO> : bool= True)

      example :

      Convertor.coco2csv('../data/train', '../data/annotations/dataset.json', '../data/annotations/dataset.csv')
      
    • csv to coco format converting
      from imgann import Convertor
      Convertor.coco2csv( <image dataset dir> : string, <csv annotated .csv file dir> : string, <coco formatted .json file dir> : string, <center COCO> : bool= True)

      example :

      Convertor.csv2coco('../data/train', '../data/annotations/dataset.csv', '../data/annotations/dataset.json')
      
    • csv to pascal VOC format converting
      from imgann import Convertor
      Convertor.csv2voc( <image dataset dir> : string, <csv annotated .csv file dir> : string, <pascal VOC formatted .xml file saving folder dir> : string)

      example :

      Convertor.coco2csv('../data/train', '../data/annotations/dataset.csv', '../data/annotations/voc_dataset')
      
    • pascal VOC to coco format converting
      from imgann import Convertor
      Convertor.voc2coco( <image dataset dir> : string, <pascal VOC annotated file included folder dir> : string, <coco formatted .json file dir> : string, <center COCO> : bool= True)

      example :

      Convertor.voc2coco('../data/train', '../data/annotations/voc_dataset', '../data/annotations/dataset.json)
      
    • pascal VOC to csv format converting
      from imgann import Convertor
      Convertor.voc2csv( <image dataset dir> : string, <pascal VOC annotated file included folder dir> : string, <csv formatted .csv file dir> : string)

      example :

      Convertor.voc2coco('../data/train', '../data/annotations/voc_dataset', '../data/annotations/dataset.csv)
      
    • csv to TF multi-label converting
      from imgann import Convertor
      Convertor.csv2multilabel( <csv dataset dir> : string, <save dir> : string)

      example :

      Convertor.csv2multilabel('../data/train/annotation.csv', '../data/annotations/dataset.csv)
      
  • To get summary of image dataset
    from imgann import Sample
    Sample.describe_data( <path to image dataset main folder> )

    example :

    Sample.describe_data('../data/train')
    
  • To get summary of complete data annotation
    from imgann import Sample
    Sample.describe_ann( <path to image dataset main folder> , <path to image annotation file/folder> , <image annotation type>['coco', 'yolo', 'csv', 'voc'], <center COCO> : bool= True)

    example :

    Sample.describe_ann('../data/train', '../data/annotations/dataset.json', 'coco')
    

ImgAnn
Copyright © 2022 @nipdep

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ImgAnn-0.8.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

ImgAnn-0.8.1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file ImgAnn-0.8.1.tar.gz.

File metadata

  • Download URL: ImgAnn-0.8.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.1

File hashes

Hashes for ImgAnn-0.8.1.tar.gz
Algorithm Hash digest
SHA256 b835705064360a246d7da399a8e02b6b4ef06c9d4af7250824715ca62ca8951f
MD5 da92cce4ab20158d390348896e02734e
BLAKE2b-256 dd132685fef7beb7f2455ac7a7f08ce5b289f62224b9f185389237ebf881b407

See more details on using hashes here.

File details

Details for the file ImgAnn-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: ImgAnn-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.1

File hashes

Hashes for ImgAnn-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67c4181863fb16713e7e23c3685448871b61f0289902e5a3fafd5d5ae9d96264
MD5 30808981feca136d4134e28bad7d3ae2
BLAKE2b-256 2f22d9d744b930e7e747de1e1caca33a25da8f8f4bb90c1cba2d4a17690edc6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page