{"id":26710465,"url":"https://github.com/YinHan-Zhang/MagicColor","last_synced_at":"2025-03-27T09:03:30.201Z","repository":{"id":284486862,"uuid":"948856491","full_name":"YinHan-Zhang/MagicColor","owner":"YinHan-Zhang","description":"The official implementation of \"MagicColor: Multi-Instance Sketch Colorization\"","archived":false,"fork":false,"pushed_at":"2025-03-26T06:12:02.000Z","size":10606,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T06:28:59.809Z","etag":null,"topics":[],"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/YinHan-Zhang.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}},"created_at":"2025-03-15T05:29:19.000Z","updated_at":"2025-03-26T06:12:05.000Z","dependencies_parsed_at":"2025-03-26T06:39:30.400Z","dependency_job_id":null,"html_url":"https://github.com/YinHan-Zhang/MagicColor","commit_stats":null,"previous_names":["yinhan-zhang/magiccolor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHan-Zhang%2FMagicColor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHan-Zhang%2FMagicColor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHan-Zhang%2FMagicColor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YinHan-Zhang%2FMagicColor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YinHan-Zhang","download_url":"https://codeload.github.com/YinHan-Zhang/MagicColor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814709,"owners_count":20676808,"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":[],"created_at":"2025-03-27T09:01:59.863Z","updated_at":"2025-03-27T09:03:30.189Z","avatar_url":"https://github.com/YinHan-Zhang.png","language":"Python","funding_links":[],"categories":["Colorization"],"sub_categories":[],"readme":"# MagicColor: Multi-Instance Sketch Colorization\n![](./asset/logo.png)\n\n## News\n\n- 2025-3-15: 🎊 source code release !\n\n## Overview\nWe present MagicColor, a diffusion-based framework for multi-instance sketch colorization. Previous methods can only achieve multi-instance sketch colorization step by step, which is time-consuming and inaccurate. In contrast, our method has the capability of coloring sketches while maintaining consistency, making multi-instance sketch colorization easier.\n\n![](./asset/intro.jpg)\n\n### Gallery\nGiven a set of references and corresponding line art images, our approach enables coloring sketches while maintaining consistency across multiple instances. Compared to traditional methods, our approach significantly improves coloring efficiency.\n\n![](./asset/teaser.jpg)\n\n\n## Set up\n\n### Environment\n\n    conda create -n MagicColor python=3.10  \n\n    pip install -r requirements.txt\n\n### Repository\n\n    git clone https://github.com/YinHan-Zhang/MagicColor.git\n    \n    cd MagicColor\n\nUse GSA to automatically extract masks:\n\n    git clone https://github.com/IDEA-Research/Grounded-Segment-Anything.git\n\nInstall Grounded-Segment-Anything see here -\u003e [install guideline](https://github.com/IDEA-Research/Grounded-Segment-Anything)\n\n    mv automatic_label.py Grounded-Segment-Anything/\n\nThen, you can train the model on your dataset:\n\n    python automatic_label.py \\\n        --config GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py \\\n        --ram_checkpoint ./ckpt/ram_swin_large_14m.pth \\\n        --grounded_checkpoint ./ckpt/groundingdino_swint_ogc.pth \\\n        --sam_checkpoint ./ckpt/sam_vit_h_4b8939.pth \\\n        --data_dir  ./data \\\n        --output_dir ./data_res \\\n        --box_threshold 0.15 \\\n        --text_threshold 0.15 \\\n        --iou_threshold 0.15 \\\n        --device \"cuda\"\n\n### Download pre-trained weight\n\n    bash download.sh\n\n### Inference\nDataset Format:\n\n    data/\n    ├── dir_name\n        ├──masks/\n            ├── mask_1.png\n            ├── mask_2.png\n            ├── ...\n            ├── mask_n.jpg\n\n        ├── dir_name_1.jpg\n        ├── dir_name_2.jpg\n        ├── ...\n        ├── dir_name_n.jpg\n        ├── sketch.jpg\n\nthen,\n\n    cd scripts\n    \n    bash multi_ref_infer.sh\n\n### Train\nDataset Format:\n\n    data/\n    ├── dir_name1\n        ├──masks/\n            ├── mask_1.png\n            ├── mask_2.png\n            ├── ...\n            ├── mask_n.jpg\n\n        ├── dir_name1_1.jpg\n        ├── dir_name1_2.jpg\n        ├── ...\n        ├── dir_name1_n.jpg\n        ├── dir_name1.jpg\n\n    ├── dir_name2\n        ├──masks/\n            ├── mask_1.png\n            ├── mask_2.png\n            ├── ...\n            ├── mask_n.jpg\n\n        ├── dir_name2_1.jpg\n        ├── dir_name2_2.jpg\n        ├── ...\n        ├── dir_name2_n.jpg\n        ├── dir_name2.jpg\n\nthen,\n\n    cd scripts\n\n    bash multi_ref_train.sh\n\n\n### Interface\nrun the script:\n \n    cd inference\n    python gradio_app.py\n\nThe gradio demo would look like the UI shown below.\n\n![](./asset/UI.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYinHan-Zhang%2FMagicColor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYinHan-Zhang%2FMagicColor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYinHan-Zhang%2FMagicColor/lists"}