Hi folks,
I’m currently performing unconditional image generation.
Input: My input is multiclass image data with 10 class of images (for example, cifar10).
Output: Expected output is to generate images for each class.
Problem: I’m able to generate images, but not able to extract/connect the class label into which the generated image belong to.
For example, I want to generate specifically Frog images from trained model based on cifar10 model
I’m not able to find the solution even in Github repo as well.
I would highly appreciate if someone could guide me on how to extract the class label.
Thanks and regards
Here is the code snippet:
!pip install diffusers
from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline
model_id = “google/ddpm-cifar10-32”
// load model and scheduler
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
// run pipeline in inference (sample random noise and denoise)
image = ddpm().images[0]
// save image
image.save(“ddpm_generated_image.png”)