Welcome to your guide on harnessing the power of the OASIS model (You Only Need Adversarial Supervision for Semantic Image Synthesis)! This PyTorch implementation allows you to generate realistic images from semantic label maps seamlessly. In this article, we’ll walk you through the setup, training, testing, and even measuring model performance. Let’s dive in!
Setup of the OASIS Model
To get started, you’ll need to clone the repository and set up the required environment:
- First, clone the repository using the following command:
git clone https://github.com/boschresearch/OASIS.git
cd OASIS
oasis.yml using Conda:conda env create --file oasis.yml
source activate oasis
Preparing Your Dataset
To train your model effectively, you’ll require datasets such as COCO-Stuff, Cityscapes, or ADE20K. Please follow the dataset preparation instructions outlined in the SPADE GitHub repository.
Training the Model
To begin training:
- Execute the training scripts present in the
scriptsfolder, ensuring you specify the path to your data folder. - You can name your experiment with the
--nameparameter:
python train.py --name my_experiment
.checkpoints directory.--continue_train flag:python train.py --continue_train
num_workers parameter of the dataloader to a higher number, like 8.Testing the Model
After training, you can test the model with:
- Run the testing scripts in the same
scriptsfolder. - Use the
--nameparameter to specify which experiment to test:
python test.py --name my_experiment
Measuring FID
The Fréchet Inception Distance (FID) is calculated during training. The default evaluation frequency can be adjusted with the --freq_fid parameter. Remember, if automatic downloads fail, manually download the inception checkpoint here and place it in the utils/fid_folder.
Using Pretrained Models
If you want to generate images right away, pretrained models are available here. Simply copy them into your checkpoints folder (create it if it doesn’t exist) and unzip the files:
python test.py --dataset_mode ade20k --name oasis_ade20k_pretrained --dataroot path_to_ADEChallenge2016
Troubleshooting Tips
Here are some common issues and their solutions:
- Problem: Package incompatibility or missing dependencies.
- Solution: Make sure your conda environment is activated. Verify the packages in
oasis.ymlare correctly installed. - Problem: Errors while downloading the pre-trained inception net.
- Solution: Download the inception checkpoint manually as mentioned earlier.
- Problem: High memory usage during training.
- Solution: Reduce the
num_workerscount or use a smaller dataset. - For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
In summary, the OASIS model opens doors to the world of semantic image synthesis. The detailed setup, training, and testing processes have been designed to simplify your experimentation. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Additional Resources
For a visual summary and further understanding, check out the 5-minute video summary and the poster included.

