{"id":19055717,"url":"https://github.com/photosynthesis-team/quasar","last_synced_at":"2025-04-24T04:29:12.111Z","repository":{"id":249403698,"uuid":"831386482","full_name":"photosynthesis-team/QUASAR","owner":"photosynthesis-team","description":"No-reference IQA/IAA metric","archived":false,"fork":false,"pushed_at":"2024-08-11T10:28:46.000Z","size":73,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-18T12:19:11.876Z","etag":null,"topics":["iaa","image-aesthetics-assessment","image-quality-assessment","iqa","metrics","pytorch","pytorch-implementation"],"latest_commit_sha":null,"homepage":"","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/photosynthesis-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-20T11:59:54.000Z","updated_at":"2025-03-07T14:32:01.000Z","dependencies_parsed_at":"2024-07-20T15:33:14.335Z","dependency_job_id":"43cdc421-2ac0-4378-a396-7a75ebe197b1","html_url":"https://github.com/photosynthesis-team/QUASAR","commit_stats":null,"previous_names":["photosynthesis-team/quasar"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photosynthesis-team%2FQUASAR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photosynthesis-team%2FQUASAR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photosynthesis-team%2FQUASAR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photosynthesis-team%2FQUASAR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/photosynthesis-team","download_url":"https://codeload.github.com/photosynthesis-team/QUASAR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250563823,"owners_count":21450898,"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":["iaa","image-aesthetics-assessment","image-quality-assessment","iqa","metrics","pytorch","pytorch-implementation"],"created_at":"2024-11-08T23:46:46.543Z","updated_at":"2025-04-24T04:29:12.077Z","avatar_url":"https://github.com/photosynthesis-team.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QUASAR\n\nThis repository contais implenetation of the paper [QUASAR: QUality and Aesthetics Scoring with Advanced Representations](https://arxiv.org/abs/2403.06866) \nby Sergey Kastryulin, Denis Prokopenko, Artem Babenko and Dmitry V. Dylov.\n\nQUASAR is a no-reference fully unsupervised metric for Image Quality and Aesthetics Assessment. It is designed to improve\nthe quality of its text-based predicessors while keeping their flexibility and generalizability.\n\n## Reproducibility\n\nThe metric is based on pre-computed centroids of image embeddings. The following code downloads them automaticaly if you do not have them in place. You can also download them manually from the [releases page](https://github.com/photosynthesis-team/QUASAR/releases/tag/embeds) or refer to the [Preprocessing](#reprocessing) section to compute them yourself.\n\nTo reproduce results reported in the paper use the `main.py` script. \n\n```bash\npython main.py [-h] [--prompt_data {text,KADIS700k,PIPAL,AVA}] [--prompt_backbone {CLIP-RN50_no-pos}] [--prompt_ratio PROMPT_RATIO] [--target_data {TID2013,KonIQ10k,KADID10k,LIVEitW,SPAQ,TAD66k,AADB,PieAPP}]\n               [--target_data_subset {None,all,train,test}] [--target_backbone {CLIP-RN50_no-pos}] [--target_cv_folds TARGET_CV_FOLDS] [--aggregation_type {mean,clustering}] [--batch_size BATCH_SIZE]\n               [--device {cpu,cuda}] [--seed SEED] [--median_offset_ratio MEDIAN_OFFSET_RATIO]\n\nScript to run an experiment\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --prompt_data {text,KADIS700k,PIPAL,AVA}\n                        The data to form anchors. `text` stands for CLIP-IQA\n  --prompt_backbone {CLIP-RN50_no-pos}\n                        Embeddings extractor for image-based prompt data\n  --prompt_ratio PROMPT_RATIO\n                        Fraction of embeddings to take for anchor forming\n  --target_data {TID2013,KonIQ10k,KADID10k,LIVEitW,SPAQ,TAD66k,AADB,PieAPP}\n                        The target dataset to compute scores and SRCC values on\n  --target_data_subset {None,all,train,test}\n                        Select which subset of target data will be used to compute SRCC values. Each dataset has its own default value because it varies in literature. Use None if not sure for a default value.\n  --target_backbone {CLIP-RN50_no-pos}\n                        Embeddings extractor for image-based prompt data\n  --target_cv_folds TARGET_CV_FOLDS\n                        Number of cross validation folds\n  --aggregation_type {mean,clustering}\n                        The way to aggregate embeddings into anchors\n  --batch_size BATCH_SIZE\n                        mind large batches for low VRAM GPUs\n  --device {cpu,cuda}\n  --seed SEED\n  --median_offset_ratio MEDIAN_OFFSET_RATIO\n                        If offset aggreation is used, this one determince the offset from the median score\n```\n\n```bash\npython main.py \\\n  --prompt_data \u003canchor dataset name\u003e \\\n  --prompt_backbone \u003cbackbone of a model to compute anchor embeds\u003e \\\n  --prompt_ratio \u003chow much data to take\u003e \\\n  --target_data \u003ctarget dataset name\u003e \\\n  --target_backbone \u003cbackbone of a model to compute target embeds\u003e \\\n  --batch_size \u003cfrom 1 to any, flex with your high VRAM GPU here\u003e \\\n  --device cuda:0 \\\n  --seed 42\n```\n\n## Preprocessing \n\nThe preprocessing step transforms the raw data to embeddings in lattent space.\n\n\n```bash\npython3 generate_embeddigs.py -h\nusage: generate_embeddigs.py [-h] [--dataset] [--dataset_dir] [--batch_size] [--resolution] [--backbone]\n                             [--backbone_type] [--pretrain] [--positional_embedding] [--no-positional_embedding]\n                             [--embeddings_dir] [--device] [--seed] [--verbose]\n\nScript to generate the features\n\noptions:\n  -h, --help            show this help message and exit\n  --dataset             supported datasets: kadis700k, pipal, tid2013, koniq10k, kadid10k, liveitw, spaq, tad66k,\n                        pieapp, sac, coyo700m.\n  --dataset_dir         path to the dataset\n  --batch_size          batch size. Choose 1 to use native resolution of the dataset.\n  --resolution          resize the images of the dataset: None, 224, 512\n  --backbone            extractor backbone: RN50, ViT-H-14, ViT-bigG-14, ViT-L-14, coca_ViT-L-14, vitl14\n  --backbone_type       extractor backbone type: clip, open-clip, dinov2\n  --pretrain            pretrain version\n  --positional_embedding\n                        enable positional embeddings\n  --no-positional_embedding\n                        disable positional embeddings\n  --embeddings_dir      path to embeddings directory\n  --device              device to use\n  --seed                random seed\n  --verbose             logs\n```\n\n```bash\npython3 generate_embeddigs.py \\\n  --dataset \u003cdataset-title\u003e \\\n  --dataset_dir \u003cpath ti dataset directory\u003e \\\n  --batch_size 1 \\\n  --backbone \u003cencoding backbone\u003e \\\n  --backbone_type \u003cencodign backbone type\u003e \\\n  --pretrain \u003cencoding backbone weights\u003e \\\n  --embeddings_dir \u003cdirectory to store embeddings\u003e \\\n  --seed 42 \\\n  --verbose \\\n  --device cuda:0 \\\n  --resolution 224 \n```\n\nCurrently supported parameters:\n```\n# Datasets\nkadis700k, pipal, tid2013, koniq10k, kadid10k, liveitw, spaq, tad66k, pieapp, sac, coyo700m\n\n# Combinations of backbone_type|backbone|preptrain|positional_embedding\n- clip|RN50|openai|True\n- clip|RN50|openai|False\n- open-clip|ViT-H-14|laion2b_s32b_b79k|None\n- open-clip|ViT-bigG-14|laion2b_s39b_b160k|None\n- open-clip|ViT-L-14|laion2B-s32B-b82K|None\n- open-clip|coca_ViT-L-14|mscoco_finetuned_laion2B-s13B-b90k|None\n- dinov2|vitl14|dinov2_vitl14|None \n```\n\n## Citation\n\n```\n@article{kastryulin2024quasar,\n  title={QUASAR: QUality and Aesthetics Scoring with Advanced Representations},\n  author={Kastryulin, Sergey and Prokopenko, Denis and Babenko, Artem and Dylov, Dmitry V},\n  journal={arXiv preprint arXiv:2403.06866},\n  year={2024}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphotosynthesis-team%2Fquasar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphotosynthesis-team%2Fquasar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphotosynthesis-team%2Fquasar/lists"}