Skip to content

Files

Latest commit

89cc44e · Jan 18, 2025

History

History

semantic_segmentation

pytorch-LFME

This is a pytorch implementation of: LFME: A Simple Framework for Learning from Multiple Experts in Domain Generalization. We use the data-spllit, pre-process, hyper-parameter settings, and evaluation protocals all from the previous art arxiv(https://github.com/Genie-Kim/PintheMemory). Our work is mainly at the train.py and deepv3plus.py files, please refer to them for details.

Pytorch Implementation

Installation Requirements

Please refer to environment.yml

How to Run

We evaludated our method on Cityscapes, Mapillary Vistas, BDD-100K which is trained on Synthia (SYNTHIA-RAND-CITYSCAPES), GTAV

  1. For Cityscapes dataset, download "leftImg8bit_trainvaltest.zip" and "gtFine_trainvaltest.zip" from https://www.cityscapes-dataset.com/downloads/
cityscapes
 └ leftImg8bit_trainvaltest
   └ leftImg8bit
     └ train
     └ val
     └ test
 └ gtFine_trainvaltest
   └ gtFine
     └ train
     └ val
     └ test
bdd-100k
 └ images
   └ train
   └ val
   └ test
 └ labels
   └ train
   └ val
mapillary
 └ training
   └ images
   └ labels
 └ validation
   └ images
   └ labels
 └ test
   └ images
   └ labels

We used GTAV_Split to split GTAV dataset into training/validation/test set. Please refer the txt files.

GTAV
 └ images
   └ train
     └ folder
   └ valid
     └ folder
   └ test   
     └ folder
 └ labels
   └ train
     └ folder
   └ valid
     └ folder
   └ test   
     └ folder

We Synthia dataset into train/val set. Please refer the txt files.

synthia
 └ RGB
   └ train
   └ val
 └ GT
   └ COLOR
     └ train
     └ val
   └ LABELS
     └ train
     └ val
  1. You should modify the dataset path to "~/dg_seg_dataset/".
datasetroot = os.path.expanduser('~/dg_seg_dataset/')

Train and Evaluation scripts

Please refer to the train and evaluation scripts in the code_semantic_segmentation/train(eval)_scripts folders.

Usage Examples

For training:  ./train_scripts/train_GS_lfe_DR50V3P.sh
For evluation: ./eval_scripts/eval_lfe_DR50V3P.sh

Then the qualitative result images saved in the same folder with pth snapshot file.