Downloads · 30 days
9
1% of all-time downloads
eurecom-ds/scoresdeve-conditional-ema-shapes3d-64
scoresdeve-conditional-ema-shapes3d-64 is a machine learning model from eurecom-ds. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers.
Downloads · 30 days
9
1% of all-time downloads
All-time downloads
1K
Public
Parameters
65.6M
992 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors262 MB · 100%
From the Hugging Face model README
# !pip install diffusers
from diffusers import DiffusionPipeline
import torch
from PIL import Image
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_id = "eurecom-ds/scoresdeve-conditional-ema-shapes3d-64"
# load model and scheduler
pipe = DiffusionPipeline.from_pretrained(model_id, trust_remote_code=True)
pipe.to(device)
# run pipeline in inference (sample random noise and denoise)
generator = torch.Generator(device=device).manual_seed(46)
class_labels = torch.tensor([[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 2, 0], # condition on shape cylinder
[0, 0, 0, 0, 3, 0], # condition on shape sphere
[0, 0, 0, 0, 4, 0], # condition on shape capsule
[0, 0, 0, 0, 0, 0], # unconditional
[1, 1, 1, 1, 1, 1], # condition on red floor, object red, orientation right, small scale, shape cube, wall red
[0, 0, 0, 0, 0, 0], # unconditional
[0, 0, 0, 0, 0, 0], # uncondtional
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0], # condition on shape cube
[0, 0, 0, 0, 1, 0] # condition on shape cube
]).to(device=pipe.device)
image = pipe(
generator=generator,
batch_size=16,
class_labels=class_labels,
num_inference_steps=1000
).images
width, height = image[0].size
# Create a new image with enough space for 2 rows x 8 columns
grid = Image.new('RGB', (width * 8, height * 2))
for index, img in enumerate(image):
x = index % 8 * width # Column index (0-7) times width of one image
y = index // 8 * height # Row index (0-1) times height of one image
grid.paste(img, (x, y))
# Save the final grid image
grid.save("sde_ve_conditional_generated_grid.png")
