{"id":17632764,"url":"https://github.com/mantasu/glasses-detector","last_synced_at":"2025-04-14T19:11:10.358Z","repository":{"id":131593800,"uuid":"610509640","full_name":"mantasu/glasses-detector","owner":"mantasu","description":"Glasses detection, classification and segmentation","archived":false,"fork":false,"pushed_at":"2025-03-15T16:26:39.000Z","size":2323,"stargazers_count":70,"open_issues_count":6,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T08:23:52.362Z","etag":null,"topics":["classification","computer-vision","cuda","detection","detector","eyeglasses","eyes","frames","glasses","gpu","lenses","mps","pytorch","segmentation","sunglasses"],"latest_commit_sha":null,"homepage":"https://mantasu.github.io/glasses-detector/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mantasu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-06T23:08:49.000Z","updated_at":"2025-04-11T02:58:45.000Z","dependencies_parsed_at":"2023-11-21T02:30:27.577Z","dependency_job_id":"cd24e29e-2635-419a-99b0-43cdb7660405","html_url":"https://github.com/mantasu/glasses-detector","commit_stats":null,"previous_names":["mantasu/glasses-detector"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantasu%2Fglasses-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantasu%2Fglasses-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantasu%2Fglasses-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantasu%2Fglasses-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mantasu","download_url":"https://codeload.github.com/mantasu/glasses-detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248539536,"owners_count":21121175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","computer-vision","cuda","detection","detector","eyeglasses","eyes","frames","glasses","gpu","lenses","mps","pytorch","segmentation","sunglasses"],"created_at":"2024-10-23T01:45:40.063Z","updated_at":"2025-04-14T19:11:10.337Z","avatar_url":"https://github.com/mantasu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/mantasu/glasses-detector/main/docs/_static/img/logo-light.png\" width=27px height=27px\u003e Glasses Detector\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Colab](https://raw.githubusercontent.com/mantasu/glasses-detector/main/docs/_static/svg/colab.svg)](https://colab.research.google.com/github/mantasu/glasses-detector/blob/main/notebooks/demo.ipynb)\n[![Docs](https://github.com/mantasu/glasses-detector/actions/workflows/sphinx.yaml/badge.svg)](https://mantasu.github.io/glasses-detector/)\n[![PyPI](https://img.shields.io/pypi/v/glasses-detector?color=yellow\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAsCAMAAAAQPRtoAAAB9VBMVEVHcEzY2Nnr6ufb2dDCxtDp6eXq6ufQz8rHycj5+vvo6OXm5d+9xctWfqDl5eTf393m5uPz8/Dbz6Zzkav40E/19fTu7u7f391Dcpnm5eOGnrJSha7vzmY7bJb00V9sjqr0y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p6BoRnA8IT1aECJwz0JZFqb3BUrFpA9laULaDx5qSyTmNxby8MzTsFOybCUZLwbiPhJrRoymLvNhv7g2/SriodVjSc/EiyOzi+TOjumJ8djF2zC3fykvhNTWhZ3yqpRk0foaAggms/Mi7ZfwoH/YPxSCnRLZ7pTKCIvmagjjluUawZ2Ssxwc8tAhtVPQtJGKlqwX5EyBrxYGCY47wuKQR+0UdfkaIV3R9eUMnwOElkjqU1AQyqsnd3wzK6scx+jiwyzlIIzfSEhXpbS5+mEslXLzRD3xNxLWxSbHlx/zQOmUOrIPFvZruZ4k15cfTwGOUec2EBhfCk8rnYIIic0GNle5sRQgtASkuO135HgbjoZzIZbPCxTlhZ0VjydXxlDgGgGpXOHlE6Wzzt4ISgpxDHlCkXQ+r3QK5vpljNAR98TdN6MWw7Urh1HuKkHHEpuJLsJO0RJA8K/f/j1qt9stBlHtFA1B8ZX0GsJwGfklAoiElU4p1xG2RgAocHKGY1ITNYK2SpwXpWYEgBwvv5Z5IpXSExyXREkURWcD4QsZmS8wAGy9fddAlK4UF2zw/VIJSd5ZychuOB0W9e6N/X0TAkf40e9/xWweGJ9cjL9Y+4NB3xQYP7U1+t+WSi6c1ROnmAj/uTQjeAPPN+ZH7Xdz2zsG+PcTKIvlyNEDHQZRT+AHJjG/tvHMglasEtgnMP7tn28pV1mXuc2hI2gElao1TyGYvlOfmqof4YOH9ot64ihrCeD4q6dO9OivvY5jx/dJLQjIXf2i+Q1hunwRFuhoIHzfZ63vIWMPjKUnT7QBWtyqKFaVXDjf1dO+h8sexQpDgk6gc69/FAbTNXOb+XLrn4n/AS3T2zxNRKClAAAAAElFTkSuQmCC)](https://pypi.org/project/glasses-detector/)\n[![Python](https://img.shields.io/badge/python-≥%203.12-blue?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAABl0RVh0U29mdHdhcmUAd3d3Lm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II7dHTtn5m4tJfmee8BhT3yeBJIiRJMynicOPo02B0x8qJwPip5osZ8yl330l1JMCX6GOpcxljlbUH+g8ifTNAnBRKQGEfaxd+XbU2CBxr4N6dAdKy7A29yG6Y7kS2t0ieVk1M49uK0260+/Ga1C2tJw0QC0cF1adq5gcI/oHVhtgpP7YglOHcJaQzH24hXkY7g6WVWDwzFbUUqyf8ASQ3KW+bpq4sAAAAASUVORK5CYII=)](https://docs.python.org/3/)\n[![CUDA](https://img.shields.io/badge/cuda-yes-5eb304?logo=nvidia)](https://developer.nvidia.com/cuda-toolkit)\n[![DOI](https://img.shields.io/badge/doi-10.5281/zenodo.8126101-ad55d9?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE9GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgNzkuZWRhMmIzZmFjLCAyMDIxLzExLzE3LTE3OjIzOjE5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tL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f03PYTpB03rPrl3RU0jxJTeWEvBYY+HiCCCS1Srpt+OuT9EYZu1cl/WXY9UraJC8bkoZN9rXAV4E67Qf2YL+mKYeb2CfFVmAf8Gfp81fc6jMXdwyYbdgIt+ncB9we2TukansgG/WCIxrK8ogsZletwgiV9YNTwPLS31aGhwk5A/TVMJj9uLeYsdgJvIRVTll4KVpeo7K4LOmp0hiLJe2Wm/Dl0ClplV9Coct69zsHWIjL1mj/m6CAy3InbuudxXO4TecU3CJSKH3rPcBh3A9E+QcyhPwv8dD8htgQUm9oCKk3NITUG+4BHP2mwwGKgTwAAAAASUVORK5CYII=)](https://zenodo.org/badge/latestdoi/610509640)\n[![License](https://img.shields.io/badge/license-MIT-red?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQfoAwYAMwyp1T9YAAAJQ0lEQVRo3sWaaWxU1xXHf2/zLMSAbUxsgj22QdixWRziJKjwIXVNgxwJmi8JfKkUUqlITSqqoipREqpIlRNlQ3Jpo5K0aVGU5ENSKUIswVGQJYelpNAGY1Nk18xSB483Anj2mdMPb97wGGw83uK/ZHnmzj33nd89993lvKcwO9KB5cAaoB64HygHCgFnuk4YGAF8QBfwL+AC8D8gOVMHlBnaLwd+CGwBGoD7gAU52AkQAgLAP4CjQDvQPzv9mrtqgN8B3Zi9KTP8SwCdwG+BldNxaKoRKQF+lv7zZP+4aNEiysrKqKqqoqysjOLiYtxuNyJCKBRicHAQn89HX18ffr+f69evj3eNXuAA8BdgaC6i8BhwMrs3Fy9eLFu2bJF9+/bJ6dOnJRgMSiwWk4kUi8VkYGBATp48KW+88YY0NTXJwoULx4tSO/DobAK4gN8Aw/YLLV26VHbt2iUdHR0SCoVkuhobG5P29nZ55plnpKioKBtmAPglk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at2RCfYr6EMCVVASfsDW3YsEFOnDgxpwCpVEo+//xzWb9+fTbEUWz5henA3BaZ4uJi2bt3rwQCgVmH8Hq98vzzz0thYWE2xN+BsulCWCoB3sU2AQCybt06aW1tFZ/PN2OAvr4+eeutt6Suri4bIAL8HiiaKYQlF/ALzGcSmQspiiLV1dWye/duOXbsmPT390s8Hp/U8VgsJoFAQA4fPizPPvusrFy5crxM6X8x37DI6Rn7VE9BDwC/Bn5C1sszTqcTj8dDbW0t1dXVeDwelixZgsvlAiAUCjE0NITX66W7u5vu7m58Ph/RaDT7Gtcxb+q3se2h5kIOzOz9p5g75wnzz5qmiWEYYhiGqKo62Ys1w5j7vSamML1ONyLZQOsxnwL/CHOlXTiFNgX4DnOVbgMOYb7DFZuOM7N1wF4CrAM2YJ7/VwGlmG8qWAeMBOaw+Tbt/NfAKcyXz3JP30yg/wOnLmUjzQSuRAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNC0wMy0wNlQwMDo1MTowNyswMDowMPvI400AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjQtMDMtMDZUMDA6NTE6MDcrMDA6MDCKlVvxAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI0LTAzLTA2VDAwOjUxOjEyKzAwOjAwQxJVFwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAASUVORK5CYII=)](https://opensource.org/licenses/MIT)\n\n\n![Banner](https://raw.githubusercontent.com/mantasu/glasses-detector/main/docs/_static/img/banner.jpg)\n\n\u003c/div\u003e\n\n## About\n\nPackage for processing images with different types of glasses and their parts. It provides a quick way to use the pre-trained models for **3** kinds of tasks, each divided into multiple categories, for instance, *classification of sunglasses* or *segmentation of glasses frames*.\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ctable align=\"center\"\u003e\u003ctbody\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003cstrong\u003eClassification\u003c/string\u003e\u003c/td\u003e \u003ctd\u003e 👓 \u003cem\u003etransparent\u003c/em\u003e 🕶️ \u003cem\u003eopaque\u003c/em\u003e 🥽 \u003cem\u003eany\u003c/em\u003e ➿\u003cem\u003eshadows\u003c/em\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003cstrong\u003eDetection\u003c/string\u003e\u003c/td\u003e \u003ctd\u003e 🤓 \u003cem\u003eworn\u003c/em\u003e 👓  \u003cem\u003estandalone\u003c/em\u003e 👀 \u003cem\u003eeye-area\u003c/em\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003cstrong\u003eSegmentation\u003c/string\u003e\u003c/td\u003e \u003ctd\u003e 😎 \u003cem\u003efull\u003c/em\u003e 🖼️ \u003cem\u003eframes\u003c/em\u003e 🦿 \u003cem\u003elegs\u003c/em\u003e 🔍 \u003cem\u003elenses\u003c/em\u003e 👥 \u003cem\u003eshadows\u003c/em\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\n$\\color{gray}{\\textit{Note: }\\text{refer to}}$ [Glasses Detector Features](https://mantasu.github.io/glasses-detector/docs/features.html) $\\color{gray}{\\text{for visual examples.}}$\n\n\u003c/div\u003e\n\n## Installation\n\n\u003e [!IMPORTANT]\n\u003e Minimum version of [Python 3.12](https://www.python.org/downloads/release/python-3120/) is **REQUIRED**. Also, you may want to install [Pytorch](https://pytorch.org/get-started/locally/) in advance to select specific configuration for your device and environment.\n\n### Pip Package\n\nIf you only need the library with pre-trained models, just install the [pip package](https://pypi.org/project/glasses-detector/) and see **Quick Start** for usage (also check [Glasses Detector Installation](https://mantasu.github.io/glasses-detector/docs/features.html) for more details):\n\n```bash\npip install glasses-detector\n```\n\nYou can also install it from the source:\n\n```bash\ngit clone https://github.com/mantasu/glasses-detector\ncd glasses-detector \u0026\u0026 pip install .\n```\n\n### Local Project\n\nIf you want to train your own models on the given datasets (or on some other datasets), just clone the project and install training requirements, then see **[Running](https://github.com/mantasu/glasses-detector?tab=readme-ov-file#running)** section to see how to run training and testing.\n\n```bash\ngit clone https://github.com/mantasu/glasses-detector\ncd glasses-detector \u0026\u0026 pip install -r requirements.txt\n```\n\nYou can create a virtual environment for your packages via [venv](https://docs.python.org/3/library/venv.html), however, if you have conda, then you can simply use it to create a new environment, for example:\n\n```bash\nconda create -n glasses-detector python=3.12\nconda activate glasses-detector \n```\n\n\u003e To set-up the datasets, refer to **[Data](https://github.com/mantasu/glasses-detector?tab=readme-ov-file#data)** section.\n\n## Quick Start\n\n### Command Line\n\nYou can run predictions via the command line. For example, classification of a single image and segmentation of images inside a directory can be performed by running:\n\n```bash\nglasses-detector -i path/to/img.jpg -t classification -d cuda -f int # Prints 1 or 0\nglasses-detector -i path/to/img_dir -t segmentation -f mask -e .jpg  # Generates masks\n```\n\n\u003e [!TIP]\n\u003e You can also specify things like `--output-path`, `--size`, `--batch-size` etc. Check the [Glasses Detector CLI](https://mantasu.github.io/glasses-detector/docs/cli.html) and [Command Line Examples](https://mantasu.github.io/glasses-detector/docs/examples.html#command-line) for more details.\n\n### Python Script\n\nYou can import the package and its models via the python script for more flexibility. Here is an example of how to classify people wearing sunglasses:\n\n```python\nfrom glasses_detector import GlassesClassifier\n\n# Generates a CSV with each line \"\u003cimg_name.jpg\u003e,\u003cTrue|False\u003e\"\nclassifier = GlassesClassifier(size=\"small\", kind=\"sunglasses\")\nclassifier.process_dir(\"path/to/dir\", \"path/to/preds.csv\", format=\"bool\")\n```\n\nAnd here is a more efficient way to process a dir for detection task (only single bbox per image is currently supported):\n\n```python\nfrom glasses_detector import GlassesDetector\n\n# Generates dir_preds with bboxes as .txt for each img\ndetector = GlassesDetector(kind=\"eyes\", device=\"cuda\")\ndetector.process_dir(\"path/to/dir\", ext=\".txt\", batch_size=64)\n```\n\n\u003e [!TIP]\n\u003e Again, there are a lot more things that can be specified, for instance, `output_size` and `pbar`. It is also possible to directly output the results or save them in a variable. See [Glasses Detector API](https://mantasu.github.io/glasses-detector/docs/api.html) and [Python Script Examples](https://mantasu.github.io/glasses-detector/docs/examples.html#python-script) for more details.\n\n### Demo\n\nFeel free to play around with some [demo image files](https://github.com/mantasu/glasses-detector/demo/). For example, after installing through [pip](https://pypi.org/project/glasses-detector/), you can run:\n\n```bash\ngit clone https://github.com/mantasu/glasses-detector \u0026\u0026 cd glasses-detector/data\nglasses-detector -i demo -o demo_labels.csv --task classification:eyeglasses\n```\n\nYou can also check out the [demo notebook](https://github.com/mantasu/glasses-detector/notebooks/demo.ipynb) which can be also accessed via [Google Colab](https://colab.research.google.com/github/mantasu/glasses-detector/blob/master/notebooks/demo.ipynb).\n\n## Data\n\nBefore downloading the datasets, please install `unrar` package, for example if you're using Ubuntu (if you're using Windows, just install [WinRAR](https://www.win-rar.com/start.html?\u0026L=0)):\n\n```bash\nsudo apt-get install unrar\n```\n\nAlso, ensure the scripts are executable:\n\n```bash\nchmod +x scripts/*\n```\n\nOnce you download all the datasets (or some that interest you), process them:\n\n```bash\npython scripts/preprocess.py --root data -f -d\n```\n\n\u003e [!TIP]\n\u003e You can also specify only certain tasks, e.g., `--tasks classification segmentation` would ignore detection datasets. It is also possible to change image size and val/test split fractions: use `--help` to see all the available CLI options.\n\nAfter processing all the datasets, your `data` directory should have the following structure:\n\n```bash\n└── data                    # The data directory (root) under project\n    ├── classification\n    │   ├── anyglasses      # Datasets with any glasses as positives\n    │   ├── eyeglasses      # Datasets with transparent glasses as positives\n    │   ├── shadows         # Datasets with visible glasses frames shadows as positives\n    │   └── sunglasses      # Datasets with semi-transparent/opaque glasses as positives \n    │\n    ├── detection\n    │   ├── eyes            # Datasets with bounding boxes for eye area \n    │   ├── solo            # Datasets with bounding boxes for standalone glasses\n    │   └── worn            # Datasets with bounding boxes for worn glasses\n    │\n    └── segmentation\n        ├── frames          # Datasets with masks for glasses frames\n        ├── full            # Datasets with masks for full glasses (frames + lenses)\n        ├── legs            # Datasets with masks for glasses legs (part of frames)\n        ├── lenses          # Datasets with masks for glasses lenses\n        ├── shadows         # Datasets with masks for eyeglasses frames cast shadows\n        └── smart           # Datasets with masks for glasses frames and lenses if opaque\n```\n\nAlmost every dataset will have `train`, `val` and `test` sub-directories. These splits for _classification_ datasets are further divided to `\u003ccategory\u003e` and `no_\u003ccategory\u003e`, for _detection_ - to `images` and `annotations`, and for _segmentation_ - to `images` and `masks` sub-sub-directories. By default, all the images are `256x256`.\n\n\u003e [!NOTE]\n\u003e Instead of downloading the datasets manually one-by-one, here is a [Kaggle Dataset](https://www.kaggle.com/datasets/mantasu/glasses-detector) that you could download which already contains everything.\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cb\u003eDownload Instructions\u003c/b\u003e\u003c/summary\u003e\n\nDownload the following files and _place them all_ inside the cloned project under directory `data` which will be your data `--root` (please note for some datasets you need to have created a free [Kaggle](https://www.kaggle.com/) account):\n\n**Classification** datasets:\n\n1. From [CMU Face Images](http://archive.ics.uci.edu/dataset/124/cmu+face+images) download `cmu+face+images.zip`\n2. From [Specs on Faces](https://sites.google.com/view/sof-dataset) download `original images.rar` and `metadata.rar`\n3. From [Sunglasses / No Sunglasses](https://www.kaggle.com/datasets/amol07/sunglasses-no-sunglasses) download `archive.zip` and _rename_ to `sunglasses-no-sunglasses.zip`\n4. From [Glasses and Coverings](https://www.kaggle.com/datasets/mantasu/glasses-and-coverings) download `archive.zip` and _rename_ to `glasses-and-coverings.zip`\n5. From [Face Attributes Grouped](https://www.kaggle.com/datasets/mantasu/face-attributes-grouped) download `archive.zip` and _rename_ to `face-attributes-grouped.zip`\n6. From [Face Attributes Extra](https://www.kaggle.com/datasets/mantasu/face-attributes-extra) download `archive.zip` and _rename_ to `face-attributes-extra.zip`\n7. From [Glasses No Glasses](https://www.kaggle.com/datasets/jorgebuenoperez/datacleaningglassesnoglasses) download `archive.zip` and _rename_ to `glasses-no-glasses.zip`\n8. From [Indian Facial Database](https://drive.google.com/file/d/1DPQQ2omEYPJDLFP3YG2h1SeXbh2ePpOq/view) download `An Indian facial database highlighting the Spectacle.zip`\n9. From [Face Attribute 2](https://universe.roboflow.com/heheteam-g9fnm/faceattribute-2) download `FaceAttribute 2.v2i.multiclass.zip` (choose `v2` and `Multi Label Classification` format)\n10. From [Glasses Shadows Synthetic](https://www.kaggle.com/datasets/mantasu/glasses-shadows-synthetic) download `archive.zip` and _rename_ to `glasses-shadows-synthetic.zip`\n\n**Detection** datasets:\n\n11. From [AI Pass](https://universe.roboflow.com/shinysky5166/ai-pass) download `AI-Pass.v6i.coco.zip` (choose `v6` and `COCO` format)\n12. From [PEX5](https://universe.roboflow.com/pex-5-ylpua/pex5-gxq3t) download `PEX5.v4i.coco.zip` (choose `v4` and `COCO` format)\n13. From [Sunglasses Glasses Detect](https://universe.roboflow.com/burhan-6fhqx/sunglasses_glasses_detect) download `sunglasses_glasses_detect.v1i.coco.zip` (choose `v1` and `COCO` format)\n14. From [Glasses Detection](https://universe.roboflow.com/su-yee/glasses-detection-qotpz) download `Glasses Detection.v2i.coco.zip` (choose `v2` and `COCO` format)\n15. From [Glasses Image Dataset](https://universe.roboflow.com/new-workspace-ld3vn/glasses-ffgqb) download `glasses.v1-glasses_2022-04-01-8-12pm.coco.zip` (choose `v1` and `COCO` format)\n16. From [EX07](https://universe.roboflow.com/cam-vrmlm/ex07-o8d6m) download `Ex07.v1i.coco.zip` (choose `v1` and `COCO` format)\n17. From [No Eyeglass](https://universe.roboflow.com/doms/no-eyeglass) download `no eyeglass.v3i.coco.zip` (choose `v3` and `COCO` format)\n18. From [Kacamata-Membaca](https://universe.roboflow.com/uas-kelas-machine-learning-blended/kacamata-membaca) download `Kacamata-Membaca.v1i.coco.zip` (choose `v1` and `COCO` format)\n19. From [Only Glasses](https://universe.roboflow.com/woodin-ixal8/onlyglasses) download `onlyglasses.v1i.coco.zip` (choose `v1` and `COCO` format)\n\n**Segmentation** datasets:\n\n20. From [CelebA Mask HQ](https://drive.google.com/file/d/1badu11NqxGf6qM3PTTooQDJvQbejgbTv/view) download `CelebAMask-HQ.zip` and from [CelebA Annotations](https://drive.google.com/file/d/1xd-d1WRnbt3yJnwh5ORGZI3g-YS-fKM9/view) download `annotations.zip`\n21. From [Glasses Segmentation Synthetic Dataset](https://www.kaggle.com/datasets/mantasu/glasses-segmentation-synthetic-dataset) download `archive.zip` and _rename_ to `glasses-segmentation-synthetic.zip`\n22. From [Face Synthetics Glasses](https://www.kaggle.com/datasets/mantasu/face-synthetics-glasses) download `archive.zip` and _rename_ to `face-synthetics-glasses.zip`\n23. From [Eyeglass](https://universe.roboflow.com/azaduni/eyeglass-6wu5y) download `eyeglass.v10i.coco-segmentation.zip` (choose `v10` and `COCO Segmentation` format)\n24. From [Glasses Lenses Segmentation](https://universe.roboflow.com/yair-etkes-iy1bq/glasses-lenses-segmentation) download `glasses lenses segmentation.v7-sh-improvments-version.coco.zip` (choose `v7` and `COCO` format)\n25. From [Glasses Lens](https://universe.roboflow.com/yair-etkes-iy1bq/glasses-lens) download `glasses lens.v6i.coco-segmentation.zip` (choose `v6` and `COCO Segmentation` format)\n26. From [Glasses Segmentation Cropped Faces](https://universe.roboflow.com/yair-etkes-iy1bq/glasses-segmentation-cropped-faces) download `glasses segmentation cropped faces.v2-segmentation_models_pytorch-s_1st_version.coco-segmentation.zip` (choose `v2` and `COCO Segmentation` format)\n27. From [Spects Segmentation](https://universe.roboflow.com/teamai-wuk2z/spects-segementation) download `Spects Segementation.v3i.coco-segmentation.zip` (choose `v3` and `COCO Segmentation`)\n28. From [KINH](https://universe.roboflow.com/fpt-university-1tkhk/kinh) download `kinh.v1i.coco.zip` (choose `v1` and `COCO` format)\n29. From [Capstone Mini 2](https://universe.roboflow.com/christ-university-ey6ms/capstone_mini_2-vtxs3) download `CAPSTONE_MINI_2.v1i.coco-segmentation.zip` (choose `v1` and `COCO Segmentation` format)\n30. From [Sunglasses Color Detection](https://universe.roboflow.com/andrea-giuseppe-parial/sunglasses-color-detection-roboflow) download `Sunglasses Color detection roboflow.v2i.coco-segmentation.zip` (choose `v2` and `COCO Segmentation` format)\n31. From [Sunglasses Color Detection 2](https://universe.roboflow.com/andrea-giuseppe-parial/sunglasses-color-detection-2) download `Sunglasses Color detection 2.v3i.coco-segmentation.zip` (choose `v3` and `COCO Segmentation` format)\n32. From [Glass Color](https://universe.roboflow.com/snap-ml/glass-color) download `Glass-Color.v1i.coco-segmentation.zip` (choose `v1` and `COCO Segmentation` format)\n\nThe table below shows which datasets are used for which tasks and their categories. Feel free to pick only the ones that interest you.\n\n\u003cdiv align=\"center\"\u003e\n\n| Task           | Category     | Dataset IDs                                                |\n| -------------- | ------------ | ---------------------------------------------------------- |\n| Classification | `anyglasses` | `1`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `14`, `15`, `16`   |\n| Classification | `eyeglasses` | `2`, `4`, `5`, `6`, `11`, `12`, `13`, `14`, `15`           |\n| Classification | `sunglasses` | `1`, `2`, `3`, `4`, `5`, `6`, `11`, `12`, `13`, `14`, `15` |\n| Classification | `shadows`    | `10`                                                       |\n| Detection      | `eyes`       | `14`, `15`, `16`, `17`                                     |\n| Detection      | `solo`       | `18`, `19`                                                 |\n| Detection      | `worn`       | `11`, `12`, `13`, `14`, `15`, `16`                         |\n| Segmentation   | `frames`     | `21`, `23`                                                 |\n| Segmentation   | `full`       | `20`, `27`, `28`                                           |\n| Segmentation   | `legs`       | `29`, `30`, `31`                                           |\n| Segmentation   | `lenses`     | `23`, `24`, `25`, `26`, `30`, `31`, `32`                   |\n| Segmentation   | `shadows`    | `21`                                                       |\n| Segmentation   | `smart`      | `22`                                                       |\n\n\u003c/div\u003e\n\n\u003c/details\u003e\n\n## Running\n\nTo run custom training and testing, it is first advised to familiarize with how [Pytorch Lightning](https://lightning.ai/docs/pytorch/stable/) works and briefly check its [CLI documentation](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli.html#lightning-cli). In particular, take into account what arguments are accepted by the [Trainer class](https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.trainer.trainer.Trainer.html#trainer) and how to customize your own [optimizer](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli_intermediate_2.html#multiple-optimizers) and [scheduler](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli_intermediate_2.html#multiple-schedulers) via command line. **Prerequisites**:\n\n1. Clone the repository\n2. Install the requirements\n3. Download and preprocess the data\n\n### Training\n\nYou can run simple training as follows (which is the default):\n```bash\npython scripts/run.py fit --task classification:anyglasses --size medium \n```\n\nYou can customize things like `batch-size`, `num-workers`, as well as `trainer` and `checkpoint` arguments:\n```bash\npython scripts/run.py fit --batch-size 64 --trainer.max_epochs 300 --checkpoint.dirname ckpt\n```\n\nIt is also possible to overwrite default optimizer and scheduler:\n```bash\npython scripts/run.py fit --optimizer Adam --optimizer.lr 1e-3 --lr_scheduler CosineAnnealingLR\n```\n\n### Testing\n\nTo run testing, specify the trained model and the checkpoint to it:\n```bash\npython scripts/run.py test -t classification:anyglasses -s small --ckpt_path path/to/model.ckpt\n```\n\nOr you can also specify the `pth` file to pre-load the model with weights:\n```bash\npython scripts/run.py test -t classification:anyglasses -s small -w path/to/weights.pth\n```\n\n\u003e If you get _UserWarning: No positive samples in targets, true positive value should be meaningless_, increase the batch size.\n\n## Credits\n\nFor references and citation, please see [Glasses Detector Credits](https://mantasu.github.io/glasses-detector/docs/credits.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantasu%2Fglasses-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmantasu%2Fglasses-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantasu%2Fglasses-detector/lists"}