-
Image Generation. For contrast and stripe illusions, we use procedural code to generate simple illusion images, which are then processed by our Color Diffusion model to create realistic illusion images. For filter illusions, we directly apply contrasting color filters to the original images. Each type of illusion also includes a corresponding control group without any illusions for comparison.
-
Question Generation. We use GPT-4o to generate image-specific questions that are designed to evaluate the model's understanding of the illusion.
-
Human Feedback. We collect human participants' feedback on these images and adjust the original classification of “illusion” and “non-illusion” based on whether participants are deceived.
Our data can be found in the following link:
RCID Dataset
To generate a realistic image from a simplified image and a text prompt using the Color Diffusion model, you can use the following code:
1import random
2import torch
3from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
4from diffusers.utils import load_image
5
6# Set device
7device = "cuda" if torch.cuda.is_available() else "cpu"
8
9# Load the models
10controlnet = ControlNetModel.from_pretrained("controlnet_model_path", torch_dtype=torch.float32).to(device)
11pipe = StableDiffusionControlNetPipeline.from_pretrained("base_model_path", controlnet=controlnet, torch_dtype=torch.float32).to(device)
12
13# Load your simplified image
14simplified_image = load_image("path_to_simplified_image.png")
15
16# Define the text prompt
17prompt = "A photorealistic image of a sunset over the ocean."
18
19# Generate realistic image
20generator = torch.manual_seed(random.randint(0, 100000))
21generated_image = pipe(prompt, num_inference_steps=50, generator=generator, image=simplified_image).images[0]
22
23# Save the generated image
24generated_image.save("generated_image.png")
The source code of this repository is released under the Apache License 2.0. The model license and dataset license are listed on their corresponding webpages.
For more information, access to the dataset, and to contribute, please visit our
Website.