{"id":18631152,"url":"https://github.com/aimagelab/art2real","last_synced_at":"2025-04-11T06:31:49.324Z","repository":{"id":68410142,"uuid":"179071972","full_name":"aimagelab/art2real","owner":"aimagelab","description":"Art2Real: Unfolding the Reality of Artworks via Semantically-Aware Image-to-Image Translation. CVPR 2019","archived":false,"fork":false,"pushed_at":"2023-03-08T07:22:06.000Z","size":5765,"stargazers_count":79,"open_issues_count":1,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-08T16:35:59.284Z","etag":null,"topics":["art2real","computer-vision","cvpr2019","deep-learning","image-to-image-translation","pytorch"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimagelab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-04-02T12:22:09.000Z","updated_at":"2024-12-05T15:24:51.000Z","dependencies_parsed_at":"2023-10-20T16:26:31.062Z","dependency_job_id":null,"html_url":"https://github.com/aimagelab/art2real","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimagelab%2Fart2real","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimagelab%2Fart2real/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimagelab%2Fart2real/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimagelab%2Fart2real/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimagelab","download_url":"https://codeload.github.com/aimagelab/art2real/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248356103,"owners_count":21090156,"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":["art2real","computer-vision","cvpr2019","deep-learning","image-to-image-translation","pytorch"],"created_at":"2024-11-07T05:05:48.518Z","updated_at":"2025-04-11T06:31:48.777Z","avatar_url":"https://github.com/aimagelab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Art2Real\nThis repository contains the reference code for the paper _[Art2Real: Unfolding the Reality of Artworks via Semantically-Aware Image-to-Image Translation](https://arxiv.org/pdf/1811.10666)_ (CVPR 2019).\n\nPlease cite with the following BibTeX:\n\n```\n@inproceedings{tomei2019art2real,\n  title={{Art2Real: Unfolding the Reality of Artworks via Semantically-Aware Image-to-Image Translation}},\n  author={Tomei, Matteo and Cornia, Marcella and Baraldi, Lorenzo and Cucchiara, Rita},\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},\n  year={2019}\n}\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"images/samples01.gif\" alt=\"Art2Real\" /\u003e\n\u003c/p\u003e\n\n## Requirements\n\nThis code is built on top of the [Cycle-GAN source code](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix).\n\nThe required Python packages are:\n* torch\u003e=0.4.1\n* torchvision\u003e=0.2.1\n* dominate\u003e=2.3.1\n* visdom\u003e=0.1.8.3\n* [faiss](https://github.com/facebookresearch/faiss/blob/master/INSTALL.md) \n\n## Pre-trained Models\n\n* **Monet2Photo** [[Checkpoints]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/checkpoints/monet2photo.zip) [[Dataset]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/datasets/monet2photo.zip)\n* **Landscape2Photo** [[Checkpoints]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/checkpoints/landscape2photo.zip) [[Dataset]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/datasets/landscape2photo.zip)\n* **Portrait2Photo** [[Checkpoints]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/checkpoints/portrait2photo.zip) [[Dataset]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/datasets/portrait2photo.zip)\n\nDownload pre-trained models and place them under the checkpoint folder. For example, when downloading the monet2photo checkpoints, place them under the folder `./checkpoints/monet2photo/`.\n\n## Test\n\nRun `python test.py` using the following arguments:\n\n| Argument | Possible values |\n|------|------|\n| `--dataroot` | Dataset root folder containing the `testA` directory |\n| `--name ` | `monet2photo`, `landscape2photo`, `portrait2photo` |\n| `--num_test ` | Number of test samples |\n\nFor example, to reproduce the results of our model for the first 100 test samples of the landscape2photo setting, use:\n```\npython test.py --dataroot ./datasets/landscape2photo --name landscape2photo --num_test 100\n```\n\n\n## Training\n\n**Note: for simplicity, the released training code does not include the regular update of semantic masks from the generated images. In this code, original painting masks are kept fixed.**\n\nTo run the training code, download the following zip folder containing RGB patches of real landscapes, FAISS indexes and masks from Monet and landscape paintings:\n* [[data for patch retrieval]](https://ailb-web.ing.unimore.it/publicfiles/drive/CVPR%202019%20-%20Art2Real/data_for_patch_retrieval.zip) \n\nPlace it under the root code folder (*i.e.* `./data_for_patch_retrieval`).\n\nRun `python train.py` using the following arguments:\n\n| Argument | Possible values |\n|------|------|\n| `--dataroot` | Dataset root folder containing the `trainA` and `trainB` directories |\n| `--name ` | Name of the experiment. It decides where to store samples and models |\n| `--no_flip ` | Since artistic masks are fixed, we do not random flip images during training |\n| `--patch_size_1 ` | Height and width of the first scale patches |\n| `--stride_1 ` | Stride of the first scale patches |\n| `--patch_size_2 ` | Height and width of the second scale patches |\n| `--stride_2 ` | Stride of the second scale patches |\n| `--patch_size_3 ` | Height and width of the third scale patches |\n| `--stride_3 ` | Stride of the third scale patches |\n| `--which_mem_bank ` | `./data_for_patch_retrieval` |\n| `--artistic_masks_dir ` | `masks_of_artistic_images_monet`, `masks_of_artistic_images_landscape` |\n| `--preload_mem_patches ` | If specified, load all RGB patches in memory |\n| `--preload_indexes ` | If specified, load all FAISS indexes in memory |\n\n* Required RAM for both RGB patches and FAISS indexes: ~40 GB.\n\n* Specify only `--patch_size_1 ` and `--stride_1 ` to run the single-scale version.\n\nFor example, to train the model on the landscape2photo setting, use:\n```\npython train.py --dataroot ./datasets/landscape2photo --name landscape2photo --no_dropout --display_id 0 --no_flip --niter_decay 100 --no_flip --patch_size_1 16 --stride_1 6 --patch_size_2 8 --stride_2 5 --patch_size_3 --stride_3 4 --which_mem_bank ./data_for_patch_retrieval --artistic_masks_dir masks_of_artistic_images_landscape --preload_mem_patches --preload_indexes\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"images/samples02.gif\" alt=\"Art2Real\" /\u003e\n\u003cimg src=\"images/samples03.gif\" alt=\"Art2Real\" /\u003e\n\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimagelab%2Fart2real","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimagelab%2Fart2real","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimagelab%2Fart2real/lists"}