{"id":21970200,"url":"https://github.com/pandede/cyclebot1001","last_synced_at":"2025-10-10T10:08:03.269Z","repository":{"id":166909256,"uuid":"307797166","full_name":"Pandede/CycleBot1001","owner":"Pandede","description":"Transfer the painting style between real-life and Van Gogh's by using CycleGAN","archived":false,"fork":false,"pushed_at":"2020-12-02T08:18:11.000Z","size":783,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T12:45:44.478Z","etag":null,"topics":["deep-learning","gan","neural-network","style-transfer"],"latest_commit_sha":null,"homepage":"https://www.instagram.com/cyclebot1001/","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/Pandede.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-27T18:46:59.000Z","updated_at":"2020-12-02T08:18:14.000Z","dependencies_parsed_at":"2023-05-21T16:30:32.615Z","dependency_job_id":null,"html_url":"https://github.com/Pandede/CycleBot1001","commit_stats":null,"previous_names":["pandede/cyclebot1001"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pandede/CycleBot1001","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pandede%2FCycleBot1001","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pandede%2FCycleBot1001/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pandede%2FCycleBot1001/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pandede%2FCycleBot1001/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pandede","download_url":"https://codeload.github.com/Pandede/CycleBot1001/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pandede%2FCycleBot1001/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003460,"owners_count":26083595,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deep-learning","gan","neural-network","style-transfer"],"created_at":"2024-11-29T14:37:56.395Z","updated_at":"2025-10-10T10:08:03.222Z","avatar_url":"https://github.com/Pandede.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CycleBot1001\nTransfer the painting style between real-life and Van Gogh's by using CycleGAN. \\\nThe instagram account: http://www.instagram.com/cyclebot1001/\n\n## Preparation\n1. Prepare the images of 2 domain for training, saved as following structure:\n```\n+-- Data\n|   +-- domain_a\n|   |   +-- 0001.png\n|   |   +-- 0002.png\n|   |   +-- ...\n|   +-- domain_b\n|   |   +-- 0001.png\n|   |   +-- 0002.png\n|   |   +-- ...\n```\nFor the convenience, you may download the **image URLs** from the following sources, including Van Gogh's painting *(Domain A)* and landmarks in real life *(Domain B)*:\n\n| Name     | Size   | Type | Link   |\n|----------|--------|------|--------|\n| Van Gogh | ~107MB | CSV  | [Google Drive](https://drive.google.com/file/d/1K51AtogQdSMnNEV5irpE1IAAVd-1DVCR/view?usp=sharing) |\n| Landmark | ~119KB | CSV  | [Google Drive](https://drive.google.com/file/d/1s4jAnVWdJ_vzbPWv83dx_v_YQS_RL4Kh/view?usp=sharing) |\n\nThen, execute the following code in python console, for example, downloading images of Van Gogh *(Domain A)*:\n```python\nimport pandas as pd\nfrom streamer import ImageStreamer\n\nsrc_list = pd.read_csv('./van_gogh.csv')['ImageURL']\ns = ImageStreamer(1024)\ns.parallel_download(src_list, './Data/domain_a/', num_workers=8, delay=1.) \n```\n- The argument in `ImageStreamer` denoted the image size of image. It can be `tuple`, `int` or `None`: \n    - the image will be resized in (1024, 256) if the argument is `tuple(1024, 256)`\n    - the image will be resized in (1024, 1024) if the argument is `int(1024)`\n    - the image will not be resized if the argment is `None`\n- `num_workers` denoted the number of threads that requesting the content simultaneously, \\\n- `delay` denoted the time interval (in sec) between each request. The usage of `delay` avoids the `Error code 429: Too many requests`.\n\n2. Edit `config.ini`\n```ini\n[default]\n# Number of training epochs\nepoch = 1000\n# Save the model each n epochs\nsave_per_epoch = 20\n# Sampling size of generating image each epoch\nsample_size = 6\n\n# The image size of generating immage\nimg_size = 1024\n# The image size for random cropped\ncrop_size = 256\n# The number of image channels (should be always RGB)\nimg_channel = 3\n# Batch size\nbatch_size = 5\n\n[path]\n# The folder path of images of Domain A\ndomain_A_src = ./Data/domain_a/\n# The folder path of images of Domain B\ndomain_B_src = ./Data/domain_b/\n# The folder path of saved model\nmodel_src = ./Pickle/\n# The folder path for saving the generated samples\nsample_src = ./Sample/ab/\n\n[cuda]\n# The device string (training on CPU if device=cpu or GPU if device=cuda)\ndevice = cuda:0\n\n[loss]\n# The lambda of cycle consistency loss for Domain A\nlambda_a = 10.0\n# The lambda of cycle consistency loss for Domain B\nlambda_b = 10.0\n# The lambda of identity loss for both domains\nlambda_idt = 0.5\n\n[wgan]\n# The clipping limit of weight (WGAN)\nweight_clipping_limit = 0.01\n```\n\n## Run\n`python main.py`\n\n## Evaluation\n**Images** or **Videos** can be rendered by `Stylizer` in `renderer.py`:\n```python\nfrom renderer import Stylizer\n\n# Render a single image\nfile_name = './sample.jpg'\nstylizer = Stylizer('./Pickle/cyclegan.pkl', domain='b', device='cuda:0')\nstylizer.render_image(file_name, './Output/', num_workers=1)\n\n# Render all images in folder\nfrom glob import glob\nfile_name = glob('./Sample/*.jpg')\nstylizer.render_image(file_name, './Output/', num_workers=8)\n\n# Render video (Beta)\nfile_name = './sample.mp4'\nstylizer.render_video(file_name, './Output/', num_workers=8)\n```\n\n## Result\nSeveral filters are implemented in `rendered.py` for combining the original and rendered images\n| Image              | Description                            | Example                                                                                                             |\n|--------------------|----------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| Original           | The genuine image                      | \u003cimg src=\"https://github.com/Pandede/CycleBot1001/blob/master/assets/heidelberg_castle.jpg\" width=\"300px\"\u003e          |\n| Rendered           | The image which rendered by GAN        | \u003cimg src=\"https://github.com/Pandede/CycleBot1001/blob/master/assets/styled_heidelberg_castle.jpg\" width=\"300px\"\u003e   |\n| **Slice**          | Combine the images simply              | \u003cimg src=\"https://github.com/Pandede/CycleBot1001/blob/master/assets/slice_heidelberg_castle.jpg\" width=\"300px\"\u003e    |\n| **Gradient Slice** | Combine the images with gradient blend | \u003cimg src=\"https://github.com/Pandede/CycleBot1001/blob/master/assets/gradient_heidelberg_castle.jpg\" width=\"300px\"\u003e |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandede%2Fcyclebot1001","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpandede%2Fcyclebot1001","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandede%2Fcyclebot1001/lists"}