auto-annotate


Nameauto-annotate JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://github.com/AlvaroCavalcante/auto_annotate
SummaryGenerate xml annotations for TensorFlow object detection models.
upload_time2023-01-10 11:32:10
maintainer
docs_urlNone
authorAlvaro Leandro Cavalcante Carneiro
requires_python>=3.8
licenseApache License 2.0
keywords tensorflow python python3 object-detection annotation dataset semi-supervised deep-learning labeling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![auto-annotate-logo](https://raw.githubusercontent.com/Lucs1590/auto_annotate/master/images/logo.png)
# Auto Annotation Tool for TensorFlow Object Detection
Are you tired to label your images by hand when working with object detection? Have hundreds or thousands of images to label? Then this project will make your life easier, just create some annotations and let the machine do the rest for you!

# Contents
- [How it works](#how)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
    - [Command line](#command-line)
    - [Code](#code)
- [Contribute](#contribute)

# 🤔 How it works <a id="how"></a>
This auto annotation tool is based on the idea of a semi-supervised architecture, where a model trained with a small amount of labeled data is used to produce the new labels for the rest of the dataset.

As simple as that, the library uses an initial and simplified object detection model to generate the XML files with the image annotations (considering the PASCAL VOC format).
Besides that, it's possible to define a confidence threshold for the detector, acting as a trade-off for the generated predictions.

If you want to know more technical details about the project, please, refer to my [Medium article](https://medium.com/p/acf410a600b8#9e0e-aaa30a9f4b7a).

# 📝 Prerequisites <a id="prerequisites"></a>
To use this library you will need a pre-trained object detection model with a subsample of your dataset. As a semi-supervised solution, it's impossible to avoid manual annotation, but you'll need to label just a small amount of your data.

It's hard to determine the number of images to label manually, once it depends on the complexity of your problem. If you want to detect dogs and cats and have 2000 images in your dataset, for example, probably 200 images are enough (100 per class). On the other hand, if you have dozens of classes or objects that are hard to detect, you should need more manual annotations to see the benefits of the semi-supervised approach.

After training this initial model, export your best checkpoint to the [SavedModel](https://www.tensorflow.org/guide/saved_model) format and you'll be ready to use the auto annotation tool!

# 💾 Installation <a id="installation"></a>
It's recommended to use a Python [virtual environment](https://docs.python.org/3/library/venv.html) to avoid any compatibility issue with your TensorFlow version. 

In your environment, you can install the project using pip:
```
$ pip install auto-annotate
```

# 👨‍🔬	Usage <a id="usage"></a>
You can use this tool either from the command line or directly in your Python code. For both, you'll have the same set of parameters:
- saved_model_path: The path of the **saved_model** folder with the initial model.
- label_map_path: The path of the **label_map.pbtxt** file.
- imgs_path: The path of the folder with your dataset images to label.
- xml_path (**optional**): Path to save the resulting XML files. The default behavior is to save in the same folder of the dataset images.
- threshold: Confidence threshold to accept the detections made by the model. the defaults is 0.5.

## Command line <a id="command-line"></a>
To use this tool from the command line, you just need to run:
```
python -m auto_annotate --label_map_path /example/label_map.pbtxt \
--saved_model_path /example/saved_model \
--imgs_path /example/dataset_images \
--xml_path /example/dataset_labels \
--threshold 0.65
```
## Code <a id="code"></a>
To use this tool from your Python code, check the following code snippet:
```python
from auto_annotate import AutoAnnotate

ann_tool = AutoAnnotate(
              saved_model_path = '/example/saved_model',
              label_map_path = '/example/label_map.pbtxt',
              images_path = '/example/dataset_images',
              xml_path = '/example/dataset_labels',
              detection_threshold = 0.65)

ann_tool.generate_annotations()
```
# 🤝 Contribute <a id="contribute"></a>
Contributions are welcome! Feel free to open a new issue if you have any problem to use the library of find a bug!

You can also use the [discussions](https://github.com/AlvaroCavalcante/auto_annotate/discussions) section to suggest improvements and ask questions!



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AlvaroCavalcante/auto_annotate",
    "name": "auto-annotate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "tensorflow,python,python3,object-detection,annotation,dataset,semi-supervised,deep-learning,labeling",
    "author": "Alvaro Leandro Cavalcante Carneiro",
    "author_email": "alvaroleandro250@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a4/23/5203b9000514082477c146da3f3296313cb12d4fc8504866eb5eb9ccdb05/auto_annotate-1.0.5.tar.gz",
    "platform": null,
    "description": "![auto-annotate-logo](https://raw.githubusercontent.com/Lucs1590/auto_annotate/master/images/logo.png)\n# Auto Annotation Tool for TensorFlow Object Detection\nAre you tired to label your images by hand when working with object detection? Have hundreds or thousands of images to label? Then this project will make your life easier, just create some annotations and let the machine do the rest for you!\n\n# Contents\n- [How it works](#how)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Command line](#command-line)\n    - [Code](#code)\n- [Contribute](#contribute)\n\n# \ud83e\udd14 How it works <a id=\"how\"></a>\nThis auto annotation tool is based on the idea of a semi-supervised architecture, where a model trained with a small amount of labeled data is used to produce the new labels for the rest of the dataset.\n\nAs simple as that, the library uses an initial and simplified object detection model to generate the XML files with the image annotations (considering the PASCAL VOC format).\nBesides that, it's possible to define a confidence threshold for the detector, acting as a trade-off for the generated predictions.\n\nIf you want to know more technical details about the project, please, refer to my [Medium article](https://medium.com/p/acf410a600b8#9e0e-aaa30a9f4b7a).\n\n# \ud83d\udcdd Prerequisites <a id=\"prerequisites\"></a>\nTo use this library you will need a pre-trained object detection model with a subsample of your dataset. As a semi-supervised solution, it's impossible to avoid manual annotation, but you'll need to label just a small amount of your data.\n\nIt's hard to determine the number of images to label manually, once it depends on the complexity of your problem. If you want to detect dogs and cats and have 2000 images in your dataset, for example, probably 200 images are enough (100 per class). On the other hand, if you have dozens of classes or objects that are hard to detect, you should need more manual annotations to see the benefits of the semi-supervised approach.\n\nAfter training this initial model, export your best checkpoint to the [SavedModel](https://www.tensorflow.org/guide/saved_model) format and you'll be ready to use the auto annotation tool!\n\n# \ud83d\udcbe Installation <a id=\"installation\"></a>\nIt's recommended to use a Python [virtual environment](https://docs.python.org/3/library/venv.html) to avoid any compatibility issue with your TensorFlow version. \n\nIn your environment, you can install the project using pip:\n```\n$ pip install auto-annotate\n```\n\n# \ud83d\udc68\u200d\ud83d\udd2c\tUsage <a id=\"usage\"></a>\nYou can use this tool either from the command line or directly in your Python code. For both, you'll have the same set of parameters:\n- saved_model_path: The path of the **saved_model** folder with the initial model.\n- label_map_path: The path of the **label_map.pbtxt** file.\n- imgs_path: The path of the folder with your dataset images to label.\n- xml_path (**optional**): Path to save the resulting XML files. The default behavior is to save in the same folder of the dataset images.\n- threshold: Confidence threshold to accept the detections made by the model. the defaults is 0.5.\n\n## Command line <a id=\"command-line\"></a>\nTo use this tool from the command line, you just need to run:\n```\npython -m auto_annotate --label_map_path /example/label_map.pbtxt \\\n--saved_model_path /example/saved_model \\\n--imgs_path /example/dataset_images \\\n--xml_path /example/dataset_labels \\\n--threshold 0.65\n```\n## Code <a id=\"code\"></a>\nTo use this tool from your Python code, check the following code snippet:\n```python\nfrom auto_annotate import AutoAnnotate\n\nann_tool = AutoAnnotate(\n              saved_model_path = '/example/saved_model',\n              label_map_path = '/example/label_map.pbtxt',\n              images_path = '/example/dataset_images',\n              xml_path = '/example/dataset_labels',\n              detection_threshold = 0.65)\n\nann_tool.generate_annotations()\n```\n# \ud83e\udd1d Contribute <a id=\"contribute\"></a>\nContributions are welcome! Feel free to open a new issue if you have any problem to use the library of find a bug!\n\nYou can also use the [discussions](https://github.com/AlvaroCavalcante/auto_annotate/discussions) section to suggest improvements and ask questions!\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Generate xml annotations for TensorFlow object detection models.",
    "version": "1.0.5",
    "split_keywords": [
        "tensorflow",
        "python",
        "python3",
        "object-detection",
        "annotation",
        "dataset",
        "semi-supervised",
        "deep-learning",
        "labeling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d1082be79cf3c55800e94605ff5a2bf3799ffe0004014424424796a0f28f73d",
                "md5": "f9129128173f1e218adea44bb47deef8",
                "sha256": "df9292f342eec8bff7386c78eaec4b9375cfc7062be6635a503f45f98fc6ad9d"
            },
            "downloads": -1,
            "filename": "auto_annotate-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9129128173f1e218adea44bb47deef8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15858,
            "upload_time": "2023-01-10T11:32:06",
            "upload_time_iso_8601": "2023-01-10T11:32:06.638069Z",
            "url": "https://files.pythonhosted.org/packages/9d/10/82be79cf3c55800e94605ff5a2bf3799ffe0004014424424796a0f28f73d/auto_annotate-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4235203b9000514082477c146da3f3296313cb12d4fc8504866eb5eb9ccdb05",
                "md5": "02357c6ff1f51070b4e85b6280d82a71",
                "sha256": "a04f88eb2603cc149f22341f43cb388cf2ef736af8a33ebd102abdfcc0749e3d"
            },
            "downloads": -1,
            "filename": "auto_annotate-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "02357c6ff1f51070b4e85b6280d82a71",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 46716,
            "upload_time": "2023-01-10T11:32:10",
            "upload_time_iso_8601": "2023-01-10T11:32:10.627477Z",
            "url": "https://files.pythonhosted.org/packages/a4/23/5203b9000514082477c146da3f3296313cb12d4fc8504866eb5eb9ccdb05/auto_annotate-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-10 11:32:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "AlvaroCavalcante",
    "github_project": "auto_annotate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "auto-annotate"
}
        
Elapsed time: 0.03713s