# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['lightly_insights']

package_data = \
{'': ['*'], 'lightly_insights': ['static/*', 'templates/*']}

install_requires = \
['jinja2>=3.1.2,<4.0.0',
 'labelformat>=0.1.1,<0.2.0',
 'matplotlib>=3.5',
 'pillow',
 'tqdm']

setup_kwargs = {
    'name': 'lightly-insights',
    'version': '0.1.0',
    'description': 'Get quick insights about your ML dataset.',
    'long_description': '# Lightly Insights\n\n![GitHub](https://img.shields.io/github/license/lightly-ai/labelformat)\n![Unit Tests](https://github.com/lightly-ai/lightly-insights/workflows/Tests/badge.svg)\n[![PyPI](https://img.shields.io/pypi/v/lightly-insights)](https://pypi.org/project/lightly-insights/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nGet quick insights about your ML dataset.\n\nLightly Insights visualises basic statistics of an image dataset. You provide a folder with images and object\ndetection labels, and it generates a static HTML webpage with metrics and plots.\n\n#### Features\n\n- Supports all object detection label formats that can be read with [Labelformat](https://github.com/lightly-ai/labelformat) package. That includes YOLO, COCO, KITTI, PascalVOC, Lightly and Labelbox.\n- Shows the image, object and class counts\n- Analyzes how many images have no labels, and provides their filenames.\n- Shows image samples\n- Shows an analysis of image and object sizes\n- Shows an analysis per class with object sizes, counts per image, location heatmap and other.\n- Typed\n- MIT licensed\n\n## Preview\n\nSee a [live example report](https://lightly-ai.github.io/lightly-insights-preview/) for a small dataset.\n\n#### Screenshots\n\n<p float="left">\n<img src="screenshot0.png" width="32%" alt="Lightly Insights Screenshot"/>\n<img src="screenshot1.png" width="32%" alt="Lightly Insights Screenshot"/>\n<img src="screenshot2.png" width="32%" alt="Lightly Insights Screenshot"/>\n</p>\n\n## Installation\n\n```\npip install lightly-insights\n```\n\n## Usage\n\nLightly Insights report is generated by a python script. This is necessary to support different label formats.\n\nThe example below uses [PascalVOC 2007](http://host.robots.ox.ac.uk/pascal/VOC/voc2007/index.html) dataset.\nYou can follow the example by downloading it (~450MB):\n\n```\nwget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar\ntar -xvf VOCtrainval_06-Nov-2007.tar\n```\n\nTo run Lightly Insights, we need to provide:\n\n* Image folder. In our case that is `./VOCdevkit/VOC2007/JPEGImages`.\n* Object detection labels. They are ingested as [Labelformat](https://github.com/lightly-ai/labelformat)\n  ObjectDetectionInput class. For PascalVOC the constructor needs the folder with annotations\n  `./VOCdevkit/VOC2007/Annotations` and the list of classes. For other format classes, please\n  refer to [Labelformat formats](https://github.com/lightly-ai/labelformat/blob/main/src/labelformat/formats/__init__.py).\n\n```py\nfrom pathlib import Path\nfrom labelformat.formats import PascalVOCObjectDetectionInput\nfrom lightly_insights import analyze, present\n\n# Analyze an image folder.\nimage_analysis = analyze.analyze_images(\n    image_folder=Path("./VOCdevkit/VOC2007/JPEGImages")\n)\n\n# Analyze object detections.\nlabel_input = PascalVOCObjectDetectionInput(\n    input_folder=Path("./VOCdevkit/VOC2007/Annotations"),\n    category_names=(\n        "person,bird,cat,cow,dog,horse,sheep,aeroplane,bicycle,boat,bus,car,"\n        + "motorbike,train,bottle,chair,diningtable,pottedplant,sofa,tvmonitor"\n    )\n)\nod_analysis = analyze.analyze_object_detections(label_input=label_input)\n\n# Create HTML report.\npresent.create_html_report(\n    output_folder=Path("./html_report"),\n    image_analysis=image_analysis,\n    od_analysis=od_analysis,\n)\n```\n\nTo view the report, open `./html_report/index.html`.\n\n## Development\n\nThe library targets python 3.7 and higher. We use poetry to manage the development environment.\n\nHere is an example development workflow:\n\n```bash\n# Create a virtual environment with development dependencies\npoetry env use python3.7\npoetry install\n\n# Make changes\n...\n\n# Autoformat the code\npoetry run make format\n\n# Run tests\npoetry run make all-checks\n```\n\n## Maintained By\n[Lightly](https://www.lightly.ai) is a spin-off from ETH Zurich that helps companies \nbuild efficient active learning pipelines to select the most relevant data for their models.\n\nYou can find out more about the company and it\'s services by following the links below:\n\n- [Homepage](https://www.lightly.ai)\n- [Web-App](https://app.lightly.ai)\n- [Lightly Solution Documentation (Lightly Worker & API)](https://docs.lightly.ai/)\n',
    'author': 'Lightly.ai',
    'author_email': 'None',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.7',
}


setup(**setup_kwargs)
