Skip to main content

image annotation file operation provider.

Project description

Total Downloads
Build Status
Version

img-ann

The imgann is a package for a simplify operations in image annotated files. such as, annotation type converting [coco format, pascalVOC format, csv format], image dataset sampling], etc.

Installation

You can install the Real Python Feed Reader from PyPI:

$ pip install imgann

The package is support Python 3.6 and above.

Usage

  • To get N number of annotated images randomly. you can use coco format, pascalVOC format or csv format as annotation format. <annotation type> 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)
      
  • 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 © 2020-2021 @nipdep

Project details


Download files

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

Files for imgann, version 0.7.11
Filename, size File type Python version Upload date Hashes
Filename, size imgann-0.7.11.tar.gz (15.1 kB) File type Source Python version None Upload date Hashes View
Filename, size imgann-0.7.11-py3-none-any.whl (18.0 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page