ecko-cli


Nameecko-cli JSON
Version 1.6.0 PyPI version JSON
download
home_pageNone
SummaryCLI tool that easily converts a directory of images into a dataset for training generative ai models
upload_time2024-11-12 02:39:15
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseCopyright 2024 Regi E Ellis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ai cli dataset florence-2 generative-ai huggingface image image-classificatioon image-processing onnx timm torch torchvision training transformers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ecko-cli

> [!IMPORTANT]
> This tools has the option to now use the JoyCaption model for captioning images. You will need to have huggingface hub
> installed to download the model and the tokenizer. Also JoyCaption is a large model and will require a GPU with
> a healthy amount of memory.
> [Demo on Huggingface](https://huggingface.co/spaces/fancyfeast/joy-caption-alpha-two) //
> [Huggingface Repo](https://huggingface.co/fancyfeast/llama-joycaption-alpha-two-hf-llava)

> [!IMPORTANT]
> This tool makes use of the `flash-attention` library, which has known to be problematic to install based on PyTorch > and CUDA versions. You may
> need to install the dependencies manually if you encounter issues. The way to install flash-attention is to clone >  the repo and install the package with pip. This is the recommended way to install the package. You can also
> install the package with pip, but you will need to clone the repo first
>
>```bash
> git clone https://github.com/Dao-AILab/flash-attention.git
> cd flash-attention
> pip install flash_attn --no-build-isolation
> pip install timm
>```
> Install via pipx
> ```bash
> pipx inject ecko-cli flash_attn
> pipx inject ecko-cli timm
>```
> Install via the CLI
> ```bash
> ecko tools install-flash-attention
>```
>

> [!NOTE]
> You may notice a delay when first using the tool...normally this means that the models
> are being downloaded/update from huggingface or that they are being moved to your
> GPU. Check your terminal to make see progress

## Overview

**ecko-cli** is a simple CLI tool that streamlines the process of processingimages in a directory, generating captions, and saving them as text files.
Additionally, it provides functionalities to create a JSONL file from images in the directory you specify. Images will be captioned using the MiaoshouAI/Florence-2-base-PromptGen-v2.0 model. Images are resized to multiple sizes for better captioning results. [1024, 768, 672, 512]. 


![screenshot](screen.png)

## Why

I wanted to create a tool that would allow me to process images in bulk quickly and efficiently for using in generative art projects. This tool
allows me to generate captions for images that I can use as training data captions for my training LORAs (Large OpenAI Research Agents) and other
generative models.


## Installation (Recommended)

You have a couple of options for installing/running the tool:

### Install [pipx](https://pipxproject.github.io/pipx/installation/), then run the tool with the following command

```bash
pipx install ecko-cli
```

### Alternatively, you can install using `pip`

```bash
pip install .
```

## Configuration

> [!IMPORTANT]
> Before using the tool, It's required to set up a `.env` file in the parent directory of the script or your home user dir [windows] or `$HOME/.config/ecko-cli-itsjustregi/.env`

The application intelligently locates your `.env` file, accommodating various platforms like Windows and Linux, or defaulting to the current directory.

## Usage // Available Commands

Once installed via pipx or pip:

```
ecko process-images /path/to/images watercolors --padding 4
```
```
ecko process-images --use_joy_cap /path/to/images watercolors --padding 4
```
```
ecko process-images /path/to/images doors --is_object True
```
```
ecko process-images /path/to/images doors --trigger WORD
```
```
ecko create-jsonl /path/to/images [dataset]
```
```
ecko ui /path/to/images
```



## Dependencies

This tool requires Python 3.11 or higher and has the following dependencies:

```bash
"typer",
"rich",
"shellingham",
"python-dotenv",
"torch",
"pillow",
"einops"
"transformers"
"timm"
"torchvision"
"huggingface_hub[cli]"
```

### Contact

For any inquiries, feedback, or suggestions, please feel free to open an issue on this repository.

### License

This project is licensed under the [MIT License](LICENSE).

---

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ecko-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "ai, cli, dataset, florence-2, generative-ai, huggingface, image, image-classificatioon, image-processing, onnx, timm, torch, torchvision, training, transformers",
    "author": null,
    "author_email": "Regi E <regi@bynine.io>",
    "download_url": "https://files.pythonhosted.org/packages/84/3f/e31f328a8928ab807f43b28a3f012462cb5a965d6b10ab0b0d5d8d8c95a9/ecko_cli-1.6.0.tar.gz",
    "platform": null,
    "description": "# ecko-cli\n\n> [!IMPORTANT]\n> This tools has the option to now use the JoyCaption model for captioning images. You will need to have huggingface hub\n> installed to download the model and the tokenizer. Also JoyCaption is a large model and will require a GPU with\n> a healthy amount of memory.\n> [Demo on Huggingface](https://huggingface.co/spaces/fancyfeast/joy-caption-alpha-two) //\n> [Huggingface Repo](https://huggingface.co/fancyfeast/llama-joycaption-alpha-two-hf-llava)\n\n> [!IMPORTANT]\n> This tool makes use of the `flash-attention` library, which has known to be problematic to install based on PyTorch > and CUDA versions. You may\n> need to install the dependencies manually if you encounter issues. The way to install flash-attention is to clone >  the repo and install the package with pip. This is the recommended way to install the package. You can also\n> install the package with pip, but you will need to clone the repo first\n>\n>```bash\n> git clone https://github.com/Dao-AILab/flash-attention.git\n> cd flash-attention\n> pip install flash_attn --no-build-isolation\n> pip install timm\n>```\n> Install via pipx\n> ```bash\n> pipx inject ecko-cli flash_attn\n> pipx inject ecko-cli timm\n>```\n> Install via the CLI\n> ```bash\n> ecko tools install-flash-attention\n>```\n>\n\n> [!NOTE]\n> You may notice a delay when first using the tool...normally this means that the models\n> are being downloaded/update from huggingface or that they are being moved to your\n> GPU. Check your terminal to make see progress\n\n## Overview\n\n**ecko-cli** is a simple CLI tool that streamlines the process of processingimages in a directory, generating captions, and saving them as text files.\nAdditionally, it provides functionalities to create a JSONL file from images in the directory you specify. Images will be captioned using the MiaoshouAI/Florence-2-base-PromptGen-v2.0 model. Images are resized to multiple sizes for better captioning results. [1024, 768, 672, 512]. \n\n\n![screenshot](screen.png)\n\n## Why\n\nI wanted to create a tool that would allow me to process images in bulk quickly and efficiently for using in generative art projects. This tool\nallows me to generate captions for images that I can use as training data captions for my training LORAs (Large OpenAI Research Agents) and other\ngenerative models.\n\n\n## Installation (Recommended)\n\nYou have a couple of options for installing/running the tool:\n\n### Install [pipx](https://pipxproject.github.io/pipx/installation/), then run the tool with the following command\n\n```bash\npipx install ecko-cli\n```\n\n### Alternatively, you can install using `pip`\n\n```bash\npip install .\n```\n\n## Configuration\n\n> [!IMPORTANT]\n> Before using the tool, It's required to set up a `.env` file in the parent directory of the script or your home user dir [windows] or `$HOME/.config/ecko-cli-itsjustregi/.env`\n\nThe application intelligently locates your `.env` file, accommodating various platforms like Windows and Linux, or defaulting to the current directory.\n\n## Usage // Available Commands\n\nOnce installed via pipx or pip:\n\n```\necko process-images /path/to/images watercolors --padding 4\n```\n```\necko process-images --use_joy_cap /path/to/images watercolors --padding 4\n```\n```\necko process-images /path/to/images doors --is_object True\n```\n```\necko process-images /path/to/images doors --trigger WORD\n```\n```\necko create-jsonl /path/to/images [dataset]\n```\n```\necko ui /path/to/images\n```\n\n\n\n## Dependencies\n\nThis tool requires Python 3.11 or higher and has the following dependencies:\n\n```bash\n\"typer\",\n\"rich\",\n\"shellingham\",\n\"python-dotenv\",\n\"torch\",\n\"pillow\",\n\"einops\"\n\"transformers\"\n\"timm\"\n\"torchvision\"\n\"huggingface_hub[cli]\"\n```\n\n### Contact\n\nFor any inquiries, feedback, or suggestions, please feel free to open an issue on this repository.\n\n### License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n",
    "bugtrack_url": null,
    "license": "Copyright 2024 Regi E Ellis  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "CLI tool that easily converts a directory of images into a dataset for training generative ai models",
    "version": "1.6.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/regiellis/ecko-cli/issues",
        "Documentation": "https://github.com/regiellis/ecko-cli/blob/main/README.md",
        "Repository": "https://github.com/regiellis/ecko-cli"
    },
    "split_keywords": [
        "ai",
        " cli",
        " dataset",
        " florence-2",
        " generative-ai",
        " huggingface",
        " image",
        " image-classificatioon",
        " image-processing",
        " onnx",
        " timm",
        " torch",
        " torchvision",
        " training",
        " transformers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b792ad8650171daf9a701fa78e4f9140e71876c1ee5ac2f4b8f20bdd2e5b50a2",
                "md5": "e7ef7bd57055d28a482b02dc46ced5b3",
                "sha256": "fe206d1a19c4d4a5b5a5cafe9118d474f7e5cf3562382e5ec3aa8877fd5b4bc2"
            },
            "downloads": -1,
            "filename": "ecko_cli-1.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e7ef7bd57055d28a482b02dc46ced5b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 265640,
            "upload_time": "2024-11-12T02:39:14",
            "upload_time_iso_8601": "2024-11-12T02:39:14.109397Z",
            "url": "https://files.pythonhosted.org/packages/b7/92/ad8650171daf9a701fa78e4f9140e71876c1ee5ac2f4b8f20bdd2e5b50a2/ecko_cli-1.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "843fe31f328a8928ab807f43b28a3f012462cb5a965d6b10ab0b0d5d8d8c95a9",
                "md5": "3d9b3d0e5999a8764aa68d0c0af76214",
                "sha256": "5d87c204b4e65dff757591b311cd2b99280329dcca12214744ffcb95bf495163"
            },
            "downloads": -1,
            "filename": "ecko_cli-1.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3d9b3d0e5999a8764aa68d0c0af76214",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 264020,
            "upload_time": "2024-11-12T02:39:15",
            "upload_time_iso_8601": "2024-11-12T02:39:15.449704Z",
            "url": "https://files.pythonhosted.org/packages/84/3f/e31f328a8928ab807f43b28a3f012462cb5a965d6b10ab0b0d5d8d8c95a9/ecko_cli-1.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-12 02:39:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "regiellis",
    "github_project": "ecko-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "ecko-cli"
}
        
Elapsed time: 0.38266s