{"id":20628782,"url":"https://github.com/sriramsk1999/facecolorizer","last_synced_at":"2026-04-20T00:33:50.012Z","repository":{"id":67350506,"uuid":"287263371","full_name":"sriramsk1999/FaceColorizer","owner":"sriramsk1999","description":"Colorizing black-and-white images of faces with a CycleGAN","archived":false,"fork":false,"pushed_at":"2020-08-13T11:59:37.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T22:13:02.121Z","etag":null,"topics":["colorization","computer-vision","cyclegan","deep-learning","tensorflow"],"latest_commit_sha":null,"homepage":"","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/sriramsk1999.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-08-13T11:38:51.000Z","updated_at":"2022-12-24T07:40:43.000Z","dependencies_parsed_at":"2023-02-24T02:31:03.265Z","dependency_job_id":null,"html_url":"https://github.com/sriramsk1999/FaceColorizer","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/sriramsk1999%2FFaceColorizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriramsk1999%2FFaceColorizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriramsk1999%2FFaceColorizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sriramsk1999%2FFaceColorizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sriramsk1999","download_url":"https://codeload.github.com/sriramsk1999/FaceColorizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242532382,"owners_count":20144727,"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":["colorization","computer-vision","cyclegan","deep-learning","tensorflow"],"created_at":"2024-11-16T13:22:50.098Z","updated_at":"2026-04-20T00:33:44.974Z","avatar_url":"https://github.com/sriramsk1999.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Face Colorizer with CycleGAN\n\nThis project is an implementation of the Cycle-consistent adversarial networks (CycleGANs), with results shown on the [Labeled Faces in the Wild dataset](http://vis-www.cs.umass.edu/lfw/). \n\nA CycleGAN is a modification of a traditional GAN, with the added constraint of *cycle consistency loss*, i.e. training pairs of generators and discriminators such that each generator can transfer from one domain to another and then back.\n\nThis project describes the process of colorizing black and white images of faces to colour after having trained on the LFW dataset, with acceptable results.\n\n#### [Model weights link](https://drive.google.com/drive/folders/1RhVaB7IG1yyOS-3fQWa1dCIqj5v3HW1g?usp=sharing)\n\nDownload and place the folder `trained/` in the working directory if pretrained weights are to be used.\n\n#### Sample Results from LFW Dataset\n\n\nFormat: Original image -\u003e Converted to black-and-white by GAN AB -\u003e Converted back to colour by GAN BA\n\n![img1](images/a_to_b_3.jpg)\n\n![img2](images/a_to_b_19.jpg)\n\n![img2](images/a_to_b_24.jpg)\n\n#### Colorizing my own face\n\n![ssk](images/ssk.jpg)\n\n### Usage\n\n#### Testing a single image\n\n`python cyclegan.py --test-single path_to_image.jpg`\n\nUses the pretrained weights in `trained/` to take in a black-and-white image, colorize it and save the result. \n\n#### Training\n\nRunning the `data_loader.py` script will:\n\n1. Download the LFW dataset.\n2. Extract and store a subset of the data in `trainA` and `testA`.\n3. Create black-and-white versions of the data in `trainB` and `testB`.\n4. Read and store images into a `h5` file.\n\nAfter which, running:\n\n`python cyclegan.py --train`\n\nWill train the network.\n\n### Repo Overview\n\n- `discriminator.py` -\u003e Definition of Discriminator\n- `generator.py` -\u003e Definition of Generator\n- `model.py` -\u003e Definition of the CycleGAN\n- `ops.py` -\u003e Various building blocks for the networks\n- `data_loader.py` -\u003e Downloads and prepares data\n- `cyclegan.py` -\u003e Training/Inference Script\n- `trained/` -\u003e Folder holding weights for pretrained model\n\n### Related: \n\n[Pix2Pix](https://phillipi.github.io/pix2pix/)\n\n[CycleGAN-Tensorflow](https://github.com/clvrai/CycleGAN-Tensorflow/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsriramsk1999%2Ffacecolorizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsriramsk1999%2Ffacecolorizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsriramsk1999%2Ffacecolorizer/lists"}