Skip to content

Instantly share code, notes, and snippets.

@shiffman
Created November 9, 2020 18:48
Show Gist options
  • Save shiffman/ada9c7003f1a042d31a675f1d95a1876 to your computer and use it in GitHub Desktop.
Save shiffman/ada9c7003f1a042d31a675f1d95a1876 to your computer and use it in GitHub Desktop.
Creating a Synthetic dataset for StyleGAN model training
void setup() {
size(400, 400, P3D);
}
void draw() {
translate(200, 200);
for (int i = 0; i < 1000; i++) {
background(0);
stroke(255);
strokeWeight(8);
fill(random(255), random(255), random(255), 150);
rotateX(random(TWO_PI));
rotateY(random(TWO_PI));
rotateZ(random(TWO_PI));
box(200);
save("output/cube"+i+".png");
}
exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment