{"id":23372879,"url":"https://github.com/jaxony/unet-pytorch","last_synced_at":"2025-07-28T02:05:12.765Z","repository":{"id":70847390,"uuid":"100146867","full_name":"jaxony/unet-pytorch","owner":"jaxony","description":"U-Net implementation for PyTorch based on https://arxiv.org/abs/1505.04597","archived":false,"fork":false,"pushed_at":"2017-12-04T03:23:16.000Z","size":42,"stargazers_count":277,"open_issues_count":1,"forks_count":63,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-07T15:51:50.884Z","etag":null,"topics":["deep-learning","neural-network","python","pytorch","semantic-segmentation"],"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/jaxony.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":"2017-08-13T01:35:37.000Z","updated_at":"2025-05-01T07:03:52.000Z","dependencies_parsed_at":"2023-07-06T10:16:20.145Z","dependency_job_id":null,"html_url":"https://github.com/jaxony/unet-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaxony/unet-pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxony%2Funet-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxony%2Funet-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxony%2Funet-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxony%2Funet-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxony","download_url":"https://codeload.github.com/jaxony/unet-pytorch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxony%2Funet-pytorch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267451489,"owners_count":24089312,"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-07-28T02:00:09.689Z","response_time":68,"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","neural-network","python","pytorch","semantic-segmentation"],"created_at":"2024-12-21T16:51:00.444Z","updated_at":"2025-07-28T02:05:12.147Z","avatar_url":"https://github.com/jaxony.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# U-Net implementation in PyTorch\n\nThe U-Net is an encoder-decoder neural network used for **semantic segmentation**. The implementation in this repository is a modified version of the U-Net proposed in [this paper](https://arxiv.org/abs/1505.04597).\n\n![U-Net Architecture](unet-architecture.png)\n\n## Features\n\n1. **You can alter the U-Net's depth.**\nThe original U-Net uses a depth of 5, as depicted in the diagram above. The word \"depth\" specifically \nrefers to the number of *different* spatially-sized convolutional outputs. With this U-Net implementation, you can easily vary the depth.\n\n2. **You can merge decoder and encoder pathways in two ways.**\nIn the original U-Net, the decoder and encoder activations are merged by concatenating channels.\nI've implemented a ResNet-style merging of the decoder and encoder activations by adding\nthese activations. This was easy to code up, but it may not make sense theoretically and has not been tested.\n\n## Pixel-wise loss for semantic segmentation\nI had some trouble getting the pixel-wise loss working correctly for a semantic segmentation task.\nHere's how I got it working in the end.\n\n```python\nfrom model import UNet\n\nmodel = UNet()\n\n# set up dataloaders, etc.\n\noutput = model(some_input_data)\n\n# permute is like np.transpose: (N, C, H, W) =\u003e (H, W, N, C)\n# contiguous is required because of this issue: https://github.com/pytorch/pytorch/issues/764\n# view: reshapes the output tensor so that we have (H * W * N, num_class)\n# NOTE: num_class == C (number of output channels)\noutput = output.permute(2, 3, 0, 1).contiguous().view(-1, num_classes)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxony%2Funet-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxony%2Funet-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxony%2Funet-pytorch/lists"}