{"id":17115415,"url":"https://github.com/920232796/setr-pytorch","last_synced_at":"2025-06-11T11:20:34.527Z","repository":{"id":53842705,"uuid":"330593954","full_name":"920232796/SETR-pytorch","owner":"920232796","description":"Implementation of SETR model, Original paper: Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers.","archived":false,"fork":false,"pushed_at":"2021-02-08T10:54:33.000Z","size":48272,"stargazers_count":132,"open_issues_count":10,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T03:35:00.504Z","etag":null,"topics":["pytorch","setr","transformer","transformer-segmentation"],"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/920232796.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}},"created_at":"2021-01-18T07:57:40.000Z","updated_at":"2025-03-29T13:05:41.000Z","dependencies_parsed_at":"2022-08-22T15:00:24.396Z","dependency_job_id":null,"html_url":"https://github.com/920232796/SETR-pytorch","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/920232796%2FSETR-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/920232796%2FSETR-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/920232796%2FSETR-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/920232796%2FSETR-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/920232796","download_url":"https://codeload.github.com/920232796/SETR-pytorch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/920232796%2FSETR-pytorch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259253749,"owners_count":22829150,"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":["pytorch","setr","transformer","transformer-segmentation"],"created_at":"2024-10-14T17:44:01.829Z","updated_at":"2025-06-11T11:20:34.497Z","avatar_url":"https://github.com/920232796.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg src=\"./SETR.png\" width=\"800px\"\u003e\u003c/img\u003e\n\n## SETR - Pytorch\n\nSince the original paper (Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers.) has no official code,I implemented SETR-Progressive UPsampling(SETR-PUP) using pytorch.\n\nOriginal paper: \u003ca href=\"https://arxiv.org/abs/2012.15840\"\u003eRethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers.\u003c/a\u003e\n\n## Vit\nThe Vit model is also implemented, and you can use it for image classification.\n\n## Usage SETR\n\n```python\nfrom SETR.transformer_seg import SETRModel\nimport torch \n\nif __name__ == \"__main__\":\n    net = SETRModel(patch_size=(32, 32), \n                    in_channels=3, \n                    out_channels=1, \n                    hidden_size=1024, \n                    num_hidden_layers=8, \n                    num_attention_heads=16, \n                    decode_features=[512, 256, 128, 64])\n    t1 = torch.rand(1, 3, 256, 256)\n    print(\"input: \" + str(t1.shape))\n    \n    # print(net)\n    print(\"output: \" + str(net(t1).shape))\n\n```\nIf the output size is (1, 1, 256, 256), the code runs successfully.\n\n## Usage Vit\n```python \nfrom SETR.transformer_seg import Vit\nimport torch \n\nif __name__ == \"__main__\":\n    model = Vit(patch_size=(7, 7), \n                    in_channels=1, \n                    out_class=10, \n                    hidden_size=1024, \n                    num_hidden_layers=1, \n                    num_attention_heads=16)\n    print(model)\n    t1 = torch.rand(1, 1, 28, 28)\n    print(\"input: \" + str(t1.shape))\n\n    print(\"output: \" + str(model(t1).shape))\n```\nThe output shape is (1, 10).\n\n## current examples\n1. task_mnist: The simplest example, using the Vit model to classify the minst dataset.\n2. task_car_seg: The example is sample segmentation task. data download: \u003ca href=\"https://www.kaggle.com/c/carvana-image-masking-challenge/data\"\u003ehttps://www.kaggle.com/c/carvana-image-masking-challenge/data\u003c/a\u003e\n\n## more\nMore examples will be updated later.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F920232796%2Fsetr-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F920232796%2Fsetr-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F920232796%2Fsetr-pytorch/lists"}