{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/matte-anything-interactive-natural-image","title":"Matte Anything: Interactive Natural Image Matting with Segment Anything Models","arxiv_id":"2306.04121","date":"2023-06-07","proceeding":null,"authors":["Jingfeng Yao","Xinggang Wang","Lang Ye","Wenyu Liu"],"abstract":"Natural image matting algorithms aim to predict the transparency map (alpha-matte) with the trimap guidance. However, the production of trimap often requires significant labor, which limits the widespread application of matting algorithms on a large scale. To address the issue, we propose Matte Anything (MatAny), an interactive natural image matting model that could produce high-quality alpha-matte with various simple hints. The key insight of MatAny is to generate pseudo trimap automatically with contour and transparency prediction. In our work, we leverage vision foundation models to enhance the performance of natural image matting. Specifically, we use the segment anything model to predict high-quality contour with user interaction and an open-vocabulary detector to predict the transparency of any object. Subsequently, a pre-trained image matting model generates alpha mattes with pseudo trimaps. MatAny is the interactive matting algorithm with the most supported interaction methods and the best performance to date. It consists of orthogonal vision models without any additional training. We evaluate the performance of MatAny against several current image matting algorithms. MatAny has 58.3% improvement on MSE and 40.6% improvement on SAD compared to the previous image matting methods with simple guidance, achieving new state-of-the-art (SOTA) performance. The source codes and pre-trained models are available at https://github.com/hustvl/Matte-Anything.","url_abs":"https://arxiv.org/abs/2306.04121v2","url_pdf":"https://arxiv.org/pdf/2306.04121v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"matte-anything-interactive-natural-image","repo_url":"https://github.com/hustvl/matte-anything","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-matting","task_name":"Image Matting"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.04121","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.04121"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hustvl/matte-anything","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_honours":1,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"edb9869f131321d2","entry":"get_rel_pos","repo":"hustvl/matte-anything","repo_kind":"official","path":"modeling/backbone/utils.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/modeling/backbone/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"edb9869f131321d2"}},{"code_sha256_prefix":"08bf7ecdb2fffe84","entry":"get_vit_lr_decay_rate","repo":"hustvl/matte-anything","repo_kind":"official","path":"configs/common/optimizer.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/configs/common/optimizer.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"08bf7ecdb2fffe84"}},{"code_sha256_prefix":"750facb8c52e8864","entry":"window_partition","repo":"hustvl/matte-anything","repo_kind":"official","path":"modeling/backbone/utils.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/modeling/backbone/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"750facb8c52e8864"}},{"code_sha256_prefix":"535942f820542fb9","entry":"window_unpartition","repo":"hustvl/matte-anything","repo_kind":"official","path":"modeling/backbone/utils.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/modeling/backbone/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"535942f820542fb9"}},{"code_sha256_prefix":"b4991ebb886e5289","entry":"gauss_kernel","repo":"hustvl/matte-anything","repo_kind":"official","path":"modeling/criterion/matting_criterion.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/modeling/criterion/matting_criterion.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b4991ebb886e5289"}},{"code_sha256_prefix":"871435a4ee3127fa","entry":"generate_checkerboard_image","repo":"hustvl/matte-anything","repo_kind":"official","path":"matte_anything.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/matte_anything.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"871435a4ee3127fa"}},{"code_sha256_prefix":"a3fadbcac00e9133","entry":"laplacian_loss","repo":"hustvl/matte-anything","repo_kind":"official","path":"modeling/criterion/matting_criterion.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/modeling/criterion/matting_criterion.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3fadbcac00e9133"}},{"code_sha256_prefix":"8a0b6d481e748e9d","entry":"laplacian_pyramid","repo":"hustvl/matte-anything","repo_kind":"official","path":"modeling/criterion/matting_criterion.py","file_url":"https://github.com/hustvl/matte-anything/blob/HEAD/modeling/criterion/matting_criterion.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8a0b6d481e748e9d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}