This is the implementation of the following paper: OpenLORIS-Object: A Dataset and Benchmark towardsLifelong Object Recognition
The current version of the code has been tested with following libs:
pytorch 1.1.0
torchvision 0.2.1
tqdm
visdom
Pillow
Install the required the packages inside the virtual environment:
$ conda create -n yourenvname python=3.7 anaconda
$ source activate yourenvname
$ pip install -r requirements.txt
Step 1: Download data following Google Drive.
Step 2: Run following scripts:
python3 benchmark1.py
python3 benchmark2.py
Step 3: Put train/test/validation file under ./img
. For more details, please follow note
file under each sub-directories in ./img
.
Step 4: Generate the .pkl
files of data.
python3 pk_gene.py
python3 pk_gene_sequence.py
You can directly use scripts on 9 algorithms and 2 benchmarks (may need to modify arguments/parameters in .bash
files if necessary):
bash clutter.bash
bash illumination.bash
bash pixel.bash
bash occlusion.bash
bash sequence.bash
Individual experiments can be run with main.py
. Main option is:
python3 main.py --factor
which kind of experiment? (clutter
|illumination
|occlusion
|pixel
)
The main option to run benchmark2 is:
python3 main.py --factor=sequence
- Elastic weight consolidation (EWC):
main.py --ewc --savepath=ewc
- Online EWC:
main.py --ewc --online --savepath=ewconline
- Synaptic intelligence (SI):
main.py --si --savepath=si
- Learning without Forgetting (LwF):
main.py --replay=current --distill --savepath=lwf
- Deep Generative Replay (DGR):
main.py --replay=generative --savepath=dgr
- DGR with distillation:
main.py --replay=generative --distill --savepath=distilldgr
- Replay-trough-Feedback (RtF):
main.py --replay=generative --distill --feedback --savepath=rtf
- Cumulative:
main.py --cumulative=1 --savepath=cumulative
- Naive:
main.py --savepath=naive
OpenLORISCode
├── img
├── lib
│ ├── callbacks.py
│ ├── continual_learner.py
│ ├── encoder.py
│ ├── exemplars.py
│ ├── replayer.py
│ ├── train.py
│ ├── vae_models.py
│ ├── visual_plt.py
├── _compare.py
├── _compare_replay.py
├── _compare_taskID.py
├── data.py
├── evaluate.py
├── excitability_modules.py
├── main.py
├── linear_nets.py
├── param_stamp.py
├── pk_gene.py
├── visual_visdom.py
├── utils.py
└── README.md
Please consider citing our papers if you use this code in your research:
@misc{1911.06487,
Author = {Qi She and Fan Feng and Xinyue Hao and Qihan Yang and Chuanlin Lan and Vincenzo Lomonaco and Xuesong Shi and Zhengwei Wang and Yao Guo and Yimin Zhang and Fei Qiao and Rosa H. M. Chan},
Title = {OpenLORIS-Object: A Dataset and Benchmark towards Lifelong Object Recognition},
Year = {2019},
Eprint = {arXiv:1911.06487},
}
Parts of code were borrowed from here.
Open a new issue or do a pull request in case you are facing any difficulty with the code base or if you want to contribute.