{"id":16388407,"url":"https://github.com/arthurdouillard/cvpr2021_plop","last_synced_at":"2025-06-21T04:35:34.808Z","repository":{"id":43919359,"uuid":"344806519","full_name":"arthurdouillard/CVPR2021_PLOP","owner":"arthurdouillard","description":"Official code of CVPR 2021's PLOP: Learning without Forgetting for Continual Semantic Segmentation","archived":false,"fork":false,"pushed_at":"2022-02-09T14:31:16.000Z","size":726,"stargazers_count":151,"open_issues_count":8,"forks_count":22,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-16T03:51:13.665Z","etag":null,"topics":["computer-vision","continual-learning","cvpr2021","deep-learning","semantic-segmentation"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2011.11390","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/arthurdouillard.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":"2021-03-05T12:37:42.000Z","updated_at":"2025-03-09T12:43:21.000Z","dependencies_parsed_at":"2022-08-12T10:51:57.908Z","dependency_job_id":null,"html_url":"https://github.com/arthurdouillard/CVPR2021_PLOP","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2FCVPR2021_PLOP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2FCVPR2021_PLOP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2FCVPR2021_PLOP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2FCVPR2021_PLOP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurdouillard","download_url":"https://codeload.github.com/arthurdouillard/CVPR2021_PLOP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243896340,"owners_count":20365361,"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","continual-learning","cvpr2021","deep-learning","semantic-segmentation"],"created_at":"2024-10-11T04:29:04.246Z","updated_at":"2025-03-16T16:31:02.746Z","avatar_url":"https://github.com/arthurdouillard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# PLOP: Learning without Forgetting for Continual Semantic Segmentation\n\n[![Paper](https://img.shields.io/badge/arXiv-2011.11390-brightgreen)](https://arxiv.org/abs/2011.11390)\n[![Conference](https://img.shields.io/badge/CVPR-2021-blue)](https://arxiv.org/abs/2011.11390)\n[![Youtube](https://img.shields.io/badge/Youtube-link-red)](https://youtu.be/GmnglAsraAM?t=2562)\n\n\u003c/div\u003e\n\n\n![Vizualization on VOC 15-1](images/plop_viz.png)\n\n\nThis repository contains all of our code. It is a modified version of\n[Cermelli et al.'s repository](https://github.com/fcdl94/MiB).\n\n\n```\n@inproceedings{douillard2021plop,\n  title={PLOP: Learning without Forgetting for Continual Semantic Segmentation},\n  authors={Douillard, Arthur and Chen, Yifu and Dapogny, Arnaud and Cord, Matthieu},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year={2021}\n}\n```\n\n# Requirements\n\nYou need to install the following libraries:\n- Python (3.6)\n- Pytorch (1.8.1+cu102)\n- torchvision (0.9.1+cu102)\n- tensorboardX (1.8)\n- apex (0.1)\n- matplotlib (3.3.1)\n- numpy (1.17.2)\n- [inplace-abn](https://github.com/mapillary/inplace_abn) (1.0.7)\n\nNote also that apex seems to only work with some CUDA versions, therefore try to install Pytorch (and torchvision) with\nthe 10.2 CUDA version. You'll probably need anaconda instead of pip in that case, sorry! Do:\n\n```\nconda install -y pytorch torchvision cudatoolkit=10.2 -c pytorch\ncd apex\npip3 install -v --no-cache-dir --global-option=\"--cpp_ext\" --global-option=\"--cuda_ext\" ./\n```\n\nNote that while the code should be runnable without mixed precision (apex), some have reported lower perfs without it. So try with it!\n\n# Dataset\n\nTwo scripts are available to download ADE20k and Pascal-VOC 2012, please see in the `data` folder.\nFor Cityscapes, you need to do it yourself, because you have to ask \"permission\" to the holders; but be\nreassured, it's only a formality, you can get the link in a few days by mail.\n\n![Performance on VOC](images/plop_voc.png)\n\n\n# How to perform training\nThe most important file is run.py, that is in charge to start the training or test procedure.\nTo run it, simpy use the following command:\n\n\u003e python -m torch.distributed.launch --nproc_per_node=\\\u003cnum_GPUs\\\u003e run.py --data_root \\\u003cdata_folder\\\u003e --name \\\u003cexp_name\\\u003e .. other args ..\n\nThe default is to use a pretraining for the backbone used, that is searched in the pretrained folder of the project.\nWe used the pretrained model released by the authors of In-place ABN (as said in the paper), that can be found here:\n [link](https://github.com/mapillary/inplace_abn#training-on-imagenet-1k). I've also upload those weights there: [link](https://github.com/arthurdouillard/CVPR2021_PLOP/releases/download/v1.0/resnet101_iabn_sync.pth.tar).\n\nSince the pretrained are made on multiple-gpus, they contain a prefix \"module.\" in each key of the network. Please, be sure to remove them to be compatible with this code (simply rename them using key = key\\[7:\\]) (if you're working on single gpu).\nIf you don't want to use pretrained, please use --no-pretrained.\n\nThere are many options (you can see them all by using --help option), but we arranged the code to being straightforward to test the reported methods.\nLeaving all the default parameters, you can replicate the experiments by setting the following options.\n- please specify the data folder using: --data_root \\\u003cdata_root\\\u003e\n- dataset: --dataset voc (Pascal-VOC 2012) | ade (ADE20K)\n- task: --task \\\u003ctask\\\u003e, where tasks are\n    - 15-5, 15-5s, 19-1 (VOC), 100-50, 100-10, 50, 100-50b, 100-10b, 50b (ADE, b indicates the order)\n- step (each step is run separately): --step \\\u003cN\\\u003e, where N is the step number, starting from 0\n- (only for Pascal-VOC) disjoint is default setup, to enable overlapped: --overlapped\n- learning rate: --lr 0.01 (for step 0) | 0.001 (for step \u003e 0)\n- batch size: --batch_size \\\u003c24/num_GPUs\\\u003e\n- epochs: --epochs 30 (Pascal-VOC 2012) | 60 (ADE20K)\n- method: --method \\\u003cmethod name\\\u003e, where names are\n    - FT, LWF, LWF-MC, ILT, EWC, RW, PI, MIB\n\nFor all details please follow the information provided using the help option.\n\n#### Example commands\n\nLwF on the 100-50 setting of ADE20K, step 0:\n\u003e python -m torch.distributed.launch --nproc_per_node=2 run.py --data_root data --batch_size 12 --dataset ade --name LWF --task 100-50 --step 0 --lr 0.01 --epochs 60 --method LWF\n\nMIB on the 50b setting of ADE20K, step 2:\n\u003e python -m torch.distributed.launch --nproc_per_node=2 run.py --data_root data --batch_size 12 --dataset ade --name MIB --task 100-50 --step 2 --lr 0.001 --epochs 60 --method MIB\n\nLWF-MC on 15-5 disjoint setting of VOC, step 1:\n\u003e python -m torch.distributed.launch --nproc_per_node=2 run.py --data_root data --batch_size 12 --dataset voc --name LWF-MC --task 15-5 --step 1 --lr 0.001 --epochs 30 --method LWF-MC\n\nPLOP on 15-1 overlapped setting of VOC, step 1:\n\u003e python -m torch.distributed.launch --nproc_per_node=2 run.py --data_root data --batch_size 12 --dataset voc --name PLOP --task 15-5s --overlapped --step 1 --lr 0.001 --epochs 30 --method FT --pod local --pod_factor 0.01 --pod_logits --pseudo entropy --threshold 0.001 --classif_adaptive_factor --init_balanced --pod_options \"{\\\"switch\\\": {\\\"after\\\": {\\\"extra_channels\\\": \\\"sum\\\", \\\"factor\\\": 0.0005, \\\"type\\\": \\\"local\\\"}}}\"\n\n\nOnce you trained the model, you can see the result on tensorboard (we perform the test after the whole training)\n or you can test it by using the same script and parameters but using the command\n\u003e --test\n\nthat will skip all the training procedure and test the model on test data.\n\nOr more simply you can use one of the provided script that will launch every step of a continual training.\n\nFor example, do\n\n````\nbash scripts/voc/plop_15-1.sh\n````\n\nNote that you will need to modify those scripts to include the path where your data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurdouillard%2Fcvpr2021_plop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurdouillard%2Fcvpr2021_plop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurdouillard%2Fcvpr2021_plop/lists"}