Giter Site home page Giter Site logo

ardalan-dsht / anylabeling-converter Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 4 KB

This Python module provides a class, AnyToCocoConverter, which converts labels from the Anylabeling image annotation app to the Microsoft COCO format. This conversion is essential for machine learning applications that require annotations in the COCO format.

Python 76.93% Jupyter Notebook 23.07%
computer-vision dataset-converter instance-segmentation object-detection

anylabeling-converter's Introduction

AnyToCocoConverter

This Python module provides a class, AnyToCocoConverter, which converts labels from the Anylabeling image annotation app to the Microsoft COCO format. This conversion is essential for machine learning applications that require annotations in the COCO format.

Features

The AnyToCocoConverter class includes several methods that facilitate the conversion process:

  • seperate_annotation_files_from_image_files_in_directory: Separates image filenames from annotation filenames in a given directory.

  • extract_polygons_from_annotaions_file: Extracts polygons from annotation files, removing unnecessary metadata.

  • extract_categories: Extracts categories (labels) from the annotations and creates dictionaries for further processing.

  • get_polygon_area: Calculates the area of a given polygon, which is required in the COCO dataset.

  • convert_images_and_annotation_instances_to_coco_format: Converts images and annotation instances to the COCO format.

  • create_coco: Creates the COCO dataset by copying images into a new directory and creating an annotations.json file.

Installation

To install this module, you can clone the repository and import the AnyToCocoConverter class into your Python script.

Usage

To use this module, you need to create an instance of the AnyToCocoConverter class, passing the root directory of your Anylabeling dataset as an argument. Then, you can call the create_coco method to create the COCO dataset. This method requires three arguments: info, licenses, and coco_root_dir, which are dictionaries and a path respectively.
Here is a basic example:

from anylabeling_converter import AnyToCocoConverter

converter = AnyToCocoConverter(anylabeling_root_dir)
converter.create_coco(info, licenses, coco_root_dir)

Contributing

Contributions to this project are welcome. Please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. Please see the LICENSE file for more details.

Contact

If you have any questions or feedback, please feel free to contact me.

Acknowledgements

I would like to thank the developers of the Anylabeling app for providing a robust platform for image annotation

anylabeling-converter's People

Contributors

ardalan-dsht avatar

Stargazers

Laidongd avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

rafapegoretti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.