{"id":13499099,"url":"https://github.com/rwightman/pytorch-dpn-pretrained","last_synced_at":"2025-04-12T23:04:38.432Z","repository":{"id":66154921,"uuid":"101685135","full_name":"rwightman/pytorch-dpn-pretrained","owner":"rwightman","description":"Dual Path Networks (DPN) supporting pretrained weights converted from original MXNet implementation ","archived":false,"fork":false,"pushed_at":"2019-06-11T22:58:03.000Z","size":25,"stargazers_count":206,"open_issues_count":1,"forks_count":47,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-12-27T08:08:34.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwightman.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}},"created_at":"2017-08-28T20:31:17.000Z","updated_at":"2024-12-14T12:20:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"57b873ff-e47d-4cd0-bbdf-2ad24c23141a","html_url":"https://github.com/rwightman/pytorch-dpn-pretrained","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fpytorch-dpn-pretrained","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fpytorch-dpn-pretrained/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fpytorch-dpn-pretrained/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fpytorch-dpn-pretrained/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwightman","download_url":"https://codeload.github.com/rwightman/pytorch-dpn-pretrained/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232721435,"owners_count":18566397,"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":"2024-07-31T22:00:28.651Z","updated_at":"2025-01-06T12:29:45.555Z","avatar_url":"https://github.com/rwightman.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes"],"sub_categories":["DPN"],"readme":"# PyTorch Pretrained Dual Path Networks (DPN)\n\nThis repository includes a PyTorch implementation of DualPathNetworks (https://arxiv.org/abs/1707.01629) that works with cypw's pretrained weights. \n\nThe code is based upon cypw's original MXNet implementation (https://github.com/cypw/DPNs) with oyam's PyTorch implementation (https://github.com/oyam/pytorch-DPNs) as a reference.\n\nOriginal testing of these models and all validation was done with torch (0.2.0.post1) and mxnet (0.11.0) pip packages installed. The models have since been updated and tested with Conda installs of PyTorch 1.0 and 1.1.\n\n## Pretrained\n\nThe model weights have already been converted to PyTorch and hosted at a fixed URL. You can use those pretrained weights by calling the model entrypoint functions with `pretrained=True`\n\n## PyTorch Hub\n\nModels can also be access via the PyTorch Hub API\n\n```\n\u003e\u003e\u003e torch.hub.list('rwightman/pytorch-dpn-pretrained')\n['dpn68', ...]\n\u003e\u003e\u003e model = torch.hub.load('rwightman/pytorch-dpn-pretrained', 'dpn68', pretrained=True)\n\u003e\u003e\u003e model.eval()\n\u003e\u003e\u003e output = model(torch.randn(1,3,224,224))\n```\n\n## Conversion\n\nIf you want to convert the weights yourself, download and untar trained weights files from https://github.com/cypw/DPNs#trained-models into a './pretrained' folder where this code is located.\n\nThe weights can be converted by running the conversion script as so:\n\n    python convert_from_mxnet.py ./pretrained/ --model dpn107\n\n## Results\n\nThe following tables contain the validation results (from included validation code) on ImageNet-1K. The DPN models are using the converted weights from the pretrained MXNet models. Also included are results from Torchvision ResNet, DenseNet as well as an InceptionV4 and InceptionResnetV2 port (by Cadene, https://github.com/Cadene/pretrained-models.pytorch) for reference. \n\nAll DPN runs at image size above 224x224 are using the mean-max pooling scheme (https://github.com/cypw/DPNs#mean-max-pooling) described by cypw.\n\nNote that results are sensitive to image crop, scaling interpolation, and even the image library used. All image operations for these models are performed with PIL. Bicubic interpolation is used for all but the ResNet models where bilinear produced better results. Results for InceptionV4 and InceptionResnetV2 where better at 100% crop, all other networks being evaluated at their native training resolution use 87.5% crop.\n\nModels with a '*' are using weights that were trained on ImageNet-5k and fine-tuned on ImageNet-1k. The MXNet weights files for these have an '-extra' suffix in their name.\n\n### Results @224x224\n\n|Model   | Prec@1 (Err)   | Prec@5 (Err)   | #Params   | Crop  |\n|---|---|---|---|---|\n| DenseNet121 | 74.752 (25.248)  | 92.152 (7.848)  | 7.98  | 87.5%  |\n| ResNet50 | 76.130 (23.870) | 92.862 (7.138) |\t25.56 | 87.5% |\n| DenseNet169 |\t75.912 (24.088) | 93.024 (6.976) | 14.15 | 87.5% |\n| DualPathNet68 | 76.346 (23.654) | 93.008 (6.992) | 12.61 | 87.5% |\n| ResNet101 | 77.374 (22.626) | 93.546 (6.454) | 44.55 | 87.5% |\n| DenseNet201 | 77.290 (22.710) | 93.478 (6.522) | 20.01 | 87.5% |\n| DenseNet161 | 77.348 (22.652) | 93.646 (6.354) | 28.68 | 87.5% |\n| DualPathNet68b* | 77.528 (22.472) | 93.846 (6.154) | 12.61 | 87.5% |\n| ResNet152 | 78.312 (21.688) | 94.046 (5.954) | 60.19 | 87.5% |\n| DualPathNet92 | 79.128 (20.872) | 94.448 (5.552) | 37.67 | 87.5% |\n| DualPathNet98 | 79.666 (20.334) | 94.646 (5.354) | 61.57 | 87.5% |\n| DualPathNet131 | 79.806 (20.194) | 94.706 (5.294) | 79.25 | 87.5% |\n| DualPathNet92* | 80.034 (19.966) | 94.868 (5.132) | 37.67 | 87.5% |\n| DualPathNet107 | 80.172 (19.828) | 94.938 (5.062) | 86.92 | 87.5% |\n\n### Results @299x299 (test_time_pool=True for DPN)\n\n|Model   | Prec@1 (Err)   | Prec@5 (Err)   | #Params   | Crop  |\n|---|---|---|---|---|\n| InceptionV3 | 77.436 (22.564) | 93.476 (6.524) | 27.16 | 87.5% |\n| DualPathNet68 | 78.006 (21.994) | 94.158 (5.842) | 12.61 | 100% |\n| DualPathNet68b* | 78.582 (21.418) | 94.470 (5.530) | 12.61 | 100% |\n| InceptionV4 | 80.138 (19.862) | 95.010 (4.99) | 42.68 | 100% |\n| DualPathNet92* | 80.408 (19.592) | 95.190 (4.810) | 37.67 | 100% |\n| DualPathNet92 | 80.480 (19.520) | 95.192 (4.808) | 37.67 | 100% |\n| InceptionResnetV2 | 80.492 (19.508) | 95.270 (4.730) | 55.85 | 100% |\n| DualPathNet98 | 81.062 (18.938) | 95.404 (4.596) | 61.57 | 100% |\n| DualPathNet131 | 81.208 (18.792) | 95.630 (4.370) | 79.25 | 100% |\n| DualPathNet107* | 81.432 (18.568) | 95.706 (4.294) | 86.92 | 100% |\n\n### Results @320x320 (test_time_pool=True)\n\n|Model   | Prec@1 (Err)   | Prec@5 (Err)   | #Params   | Crop  |\n|---|---|---|---|---|\n| DualPathNet68 | 78.450 (21.550) | 94.358 (5.642) | 12.61 | 100% |\n| DualPathNet68b* | 78.764 (21.236) | 94.726 (5.274) | 12.61 | 100% |\n| DualPathNet92* | 80.824 (19.176) | 95.570 (4.430) | 37.67 | 100% |\n| DualPathNet92 | 80.960 (19.040) | 95.500 (4.500) | 37.67 | 100% |\n| DualPathNet98 | 81.276 (18.724) | 95.666 (4.334) | 61.57 | 100% |\n| DualPathNet131 | 81.458 (18.542) | 95.786 (4.214) | 79.25 | 100% |\n| DualPathNet107* | 81.800 (18.200) | 95.910 (4.090) | 86.92 | 100% |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwightman%2Fpytorch-dpn-pretrained","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwightman%2Fpytorch-dpn-pretrained","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwightman%2Fpytorch-dpn-pretrained/lists"}