{"id":17223968,"url":"https://github.com/adeelh/pytorch-fpn","last_synced_at":"2025-04-14T00:25:27.557Z","repository":{"id":45213296,"uuid":"299849703","full_name":"AdeelH/pytorch-fpn","owner":"AdeelH","description":"PyTorch implementations of some FPN-based semantic segmentation architectures: vanilla FPN, Panoptic FPN, PANet FPN; with ResNet and EfficientNet backbones.","archived":false,"fork":false,"pushed_at":"2023-06-30T16:29:41.000Z","size":59,"stargazers_count":55,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:47:18.283Z","etag":null,"topics":["computer-vision","deep-learning","deeplearning","efficientnet","feature-pyramid-network","fpn","implementation-of-research-paper","machine-learning","neural-network","pytorch","pytorch-fpn","pytorch-implementation","resnet","semantic-segmentation","semantic-segmentation-architectures"],"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/AdeelH.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}},"created_at":"2020-09-30T08:01:22.000Z","updated_at":"2025-03-18T00:44:16.000Z","dependencies_parsed_at":"2022-08-26T00:22:07.347Z","dependency_job_id":null,"html_url":"https://github.com/AdeelH/pytorch-fpn","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdeelH%2Fpytorch-fpn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdeelH%2Fpytorch-fpn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdeelH%2Fpytorch-fpn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdeelH%2Fpytorch-fpn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdeelH","download_url":"https://codeload.github.com/AdeelH/pytorch-fpn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248800104,"owners_count":21163404,"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":["computer-vision","deep-learning","deeplearning","efficientnet","feature-pyramid-network","fpn","implementation-of-research-paper","machine-learning","neural-network","pytorch","pytorch-fpn","pytorch-implementation","resnet","semantic-segmentation","semantic-segmentation-architectures"],"created_at":"2024-10-15T04:09:42.241Z","updated_at":"2025-04-14T00:25:27.521Z","avatar_url":"https://github.com/AdeelH.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytorch-fpn\n\nPyTorch implementation of the following semantic segmentation architectures (see `fpn.py`):\n- **FPN**, *Feature Pyramid Networks for Object Detection* by Lin et al., https://arxiv.com/abs/1612.03144.\n- **Panoptic FPN**, *Panoptic Feature Pyramid Networks* by Kirilov et al., https://arxiv.com/abs/1901.02446.\n- **PANet FPN**, *Path Aggregation Network for Instance Segmentation* by Liu et al., https://arxiv.com/abs/1803.01534\n\nThe implementations are all based on `nn.Sequential` with no fancy forward methods, meaning that they can be easily modified and combined together or with other modules.\n\n\n# Backbones\nThe repo provides factory functions (`make_fpn_resnet()` and `make_fpn_efficientnet()`) for creating FPN's with 2 kinds of backbones:\n- ResNet backbones (via Torch Vision)\n- EfficientNet backbones (via https://github.com/lukemelas/EfficientNet-PyTorch)\n\n\n# Multiband images\nThe factory methods `make_fpn_resnet()` and `make_fpn_efficientnet()` support `in_channels != 3`.\n\n`make_fpn_resnet()`, in particular, makes use of the fusion technique described in the paper, *FuseNet*, by Hazirbas et al. (https://vision.in.tum.de/_media/spezial/bib/hazirbasma2016fusenet.pdf) if `in_channels \u003e 3` that adds a parallel resnet backbone for the new channels. All the pretrained weights are retained.\n\n# Usage\n\n```python\nfrom factory import make_fpn_resnet\n\nmodel = make_fpn_resnet(\n\tname='resnet18',\n\tfpn_type='fpn',\n\tpretrained=True,\n\tnum_classes=2,\n\tfpn_channels=256,\n\tin_channels=3,\n\tout_size=(224, 224))\n\n```\n\n# Loading through torch.hub\nThis repo supports importing modules through `torch.hub`. The models can be easily imported into your code via the factory functions in `factory.py`.\n\n```python\n\nimport torch\n\nmodel = torch.hub.load(\n\t'AdeelH/pytorch-fpn',\n\t'make_fpn_resnet',\n\tname='resnet18',\n\tfpn_type='panoptic',\n\tnum_classes=2,\n\tfpn_channels=256,\n\tin_channels=3,\n\tout_size=(224, 224)\n)\n\n```\n\nWorking example on Colab: https://colab.research.google.com/drive/1pjkw-QoqiXgKDrEYZ47EwfXcW7vgO4KX?usp=sharing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadeelh%2Fpytorch-fpn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadeelh%2Fpytorch-fpn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadeelh%2Fpytorch-fpn/lists"}