• Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    HTML
  • Created over 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generating Cat images using StyleGAN

These Cats Don't Exist

Generating Cat images using StyleGAN on AWS SageMaker. Developing a simple and repeatable Data Science pipeline for Generative Adversarial Network outputs

img/catgen

Website

Create Bucket

aws s3 mb s3://thesecatsdonotexist.com

Copy in Files

aws s3 cp index.html s3://thesecatsdonotexist.com/index.html

Generate the Cats

jupyter-notebook notebooks/catgen.ipynb

StyleGAN Model Copy

Obtain the cat gen model from the original repository (or you can get it from my s3 bucket https://s3.amazonaws.com/devopstar/resources/aws-catgen/models/karras2019stylegan-cats-256x256.pkl

aws s3 mb s3://devopstar
aws s3 cp model/karras2019stylegan-cats-256x256.pkl s3://resources/aws-catgen/models/karras2019stylegan-cats-256x256.pkl

AWS SageMaker Generate

WARNING: You will be paying > $2 per hour running this notebook. Ensure you delete it or turn it off when you aren't using it.

Create the SageMaker role that we'll attach to our SageMaker instance. Unfortunately since CloudFormation options for SageMaker do not allow us to attach Git repos as options yet.

aws cloudformation create-stack \
    --stack-name "cat-gen-sagemaker-role" \
    --template-body file://cloudformation/sagemaker_role.yaml \
    --parameters ParameterKey=S3BucketName,ParameterValue="devopstar" \
    --capabilities CAPABILITY_IAM

Once the role has been created successfully, retrieve the ARN for the use in the steps to follow.

aws cloudformation describe-stacks --stack-name "cat-gen-sagemaker-role" \
    --query 'Stacks[0].Outputs[?OutputKey==`MLNotebookExecutionRole`].OutputValue' \
    --output text

It will look something like arn:aws:iam::XXXXXXXXXXXX:role/cat-gen-sagemaker-role-ExecutionRole-PZL3SA3IZPSN.

Next create a Code repository and pass it in the repo https://github.com/t04glovern/stylegan

aws sagemaker create-code-repository \
    --code-repository-name "t04glover-stylegan" \
    --git-config '{"Branch":"master", "RepositoryUrl" : "https://github.com/t04glovern/stylegan" }'

Finally create the notebook instance ensuring you pass in the Role ARN from before, and the default code repository we just created.

aws sagemaker create-notebook-instance \
    --notebook-instance-name "cat-gen" \
    --instance-type "ml.p2.xlarge" \
    --role-arn "arn:aws:iam::XXXXXXXXXXXXX:role/cat-gen-sagemaker-role-ExecutionRole-PZL3SA3IZPSN" \
    --default-code-repository "t04glover-stylegan"

Once completed, open in JupyterLab

Setup 01

You should be presented with the StyleGAN repository that we set as the default when creating the repository. Open the catgen notebook

Setup 02

Select the kernel to use, in our case its conda_tensorflow_p36

Setup 03

Begin to execute the notebook using the controls at the top of the notebook, you might run into some issues when bringing in the role; I've found this to be a benign issue through.

Error 01

Finally after loading in the Pickle, we generate cats by running the last section over and over again.

Setup 04

Removing Resources

Due to costs being really high, we need to destory the resources when we aren't using them. Start by shutting down the notebook (you can also delete it if you want)

UI

Delete 01

Delete 02

CLI

aws sagemaker delete-notebook-instance \
    --notebook-instance-name "cat-gen"

aws sagemaker delete-code-repository \
    --code-repository-name "t04glover-stylegan"

aws cloudformation delete-stack \
    --stack-name "cat-gen-sagemaker-role"

More Repositories

1

selfie2anime

Anime2Selfie Backend Services - Lambda, Queue, API Gateway and traffic processing
Python
175
star
2

catbox

๐Ÿ™€ A Cat adoption app that displays cats that are up for adoption, utilising Cloud Firestore, Firebase Functions and Google Sign In.
Dart
71
star
3

gpt-2-flask-api

OpenAI GPT-2 Flask API
Python
51
star
4

stylegan-pokemon

Generating Pokemon cards using a mixture of StyleGAN and RNN to create beautiful & vibrant cards ready for battle!
Python
50
star
5

awesome-exapunks

EXAPUNKS EXAplained - Casual walkthrough of the thought process I followed while completing the levels
48
star
6

dog-bark-detection

Jupyter Notebook
30
star
7

cryptodoggies

๐Ÿถ Purchase your favourite Digital Crypto Doggies on the blockchain
JavaScript
24
star
8

selfie2anime-tutorial

Python
22
star
9

azure-iot-trashe

Trashรฉ is a SmartBin which aim to help you get better at recycling. Making use of Azure IoT Edge we're able to leverage our trash detection model to detect plastic, glass & metals in realtime.
Python
22
star
10

catbox-code

Code for the catbox Udemy course
Dart
18
star
11

aws-greener-grass

Reference architecture for deploying and managing Greengrass components.
TypeScript
15
star
12

traffic-cop

WiFi Beacon & Client sniffing pipeline for analysing the movements of Human Traffickers.
C++
13
star
13

service-slayer

Service Slayer is the demo project Iโ€™ve setup to demo nested CloudFormation stacks
JavaScript
13
star
14

open-distro-kickstart

A short kickstart project for working with Open Distro for Elasticsearch in a practical way. Load in podcast data from The Dollop and analyse the data visually using dashboards
12
star
15

aws-dynamodb-leaderboard

Learn to use NoSQL Workbench with Amazon DynamoDB to create a leaderboard system with global secondary indexes.
10
star
16

gpt2-k8s-cloud-run

Containerising PyTorch models in a repeatable way. Deploy OpenAI's GPT-2 model and expose it over a Flask API. Finally deploy it to GCP repositories and publish it on a k8s cluster using Cloud Run.
Python
10
star
17

free4students

A detailed list of free software for ICT students and I guess students in general
9
star
18

aws-opencv-serverless

Run OpenCV 4.0 on Lambda using Serverless framework
Python
8
star
19

aws-ffmpeg-serverless-convert

JavaScript
8
star
20

aws-greengrass-bricks

Get started here: https://devopstar.com/2022/09/21/aws-iot-greengrass-v2-learning-environment
Jupyter Notebook
8
star
21

aws-amplify-resume

Build a Serverless Resume that makes use of AWS Amplify to dynamically display work history
JavaScript
7
star
22

aws-esp32-cam

Example for publishing images from an ESP32-CAM to AWS IoT over MQTT
C++
6
star
23

icface

Repository cleanup of https://github.com/Blade6570/icface while I play around with it.
Python
6
star
24

neural-painters

Playing around with reiinakano/neural-painters examples
Jupyter Notebook
6
star
25

terraform-repo-template

A pretty good terraform template repository to use as a starter for publicly or privately sharing terraform modules
HCL
6
star
26

linkedin-professional

LinkedIn Professional is a POC program that helps you boost your career by automatically updating your LinkedIn profile with the hottest new skills in tech based on the Technology Radar
Python
5
star
27

amazon-managed-grafana-api-key-rotation-terraform

A simple terraform project that demonstrates how you can rotate an API key for an Amazon Managed Grafana instance.
HCL
5
star
28

stubber

๐ŸŽŸ Deterring ticket scalping with digitally traceable ticket sales on the blockchain.
JavaScript
5
star
29

agridex

A Flutter app that helps manage farm livestock
Dart
5
star
30

espressif-mqtt-publish

Espressif X.509 MQTT Publisher specifically for connecting to AWS IoT via certificates.
C
5
star
31

aws-pptp-cloudformation

Deploying a Private VPN to AWS EC2 using CloudFormation
5
star
32

gke-dm-bootstrap

Google Cloud Platform Deployment Manager bootstrap for GKE. Infrastructure as code for the difficult task of deploying and managing Kubernetes & Google Cloud resources
Python
5
star
33

deep-dune-coloring

Automatic coloring and shading of Dune coloring book using manga-style lineart model from deepcolor. Makes use of Tensorflow + cGANs
Python
5
star
34

aws-textract-adoption-forms

Using Serverless to consume and processing WA Animals adoption forms using Amazon Textract and placing that data in DynamoDB
Python
5
star
35

nathanglover-gatsby-portfolio

A portfolio site for Nathan Glover on Gatsby integrated with Contentful CMS.
JavaScript
4
star
36

esp-idf-aws-iot

Sample repository for working with ESP-IDF on AWS IoT with the ESP32
C
4
star
37

planet-money-generator

Trained text-generating neural network that generates episodes of Planet Money
HTML
4
star
38

roles-anywhere-codespaces

Shell
4
star
39

aws-serverless-dyson

Using Dyson Pure Cool Link python library & Serverless framework we implement a simple endpoint to control our Dyson device.
Python
4
star
40

nintendo-switch-k8s

Running Kubernetes on the Nintendo Switch
3
star
41

aws-greengrassv2-cat-feeder

AWS IoT Greengrass component to feed your cat
Python
3
star
42

stubber.space

๐ŸŽŸ Deterring ticket scalping with digitally traceable ticket sales on the blockchain.
JavaScript
3
star
43

doggy-id-parser

Official Doggy Generation Library for the CryptoDoggies Ethereum Smart Contract
HTML
3
star
44

intel-101-hackathon

C#
3
star
45

aws-butlerbot

Handles pushing messages out to a Slack channel as ButlerBot
JavaScript
3
star
46

terraform-aws-s3-access-grants

Example for how to use AWS S3 Access Grants with Terraform
HCL
3
star
47

UK101

Contains various basic code files taken from a family member of my partner who recently passed away. The code was originally written for the Compukit UK101 system but can be also be run on the Superboard II
3
star
48

eks-kubeflow-demo

Shell
2
star
49

alexa-random-quotes

Alexa chatbot that returns random quotes
JavaScript
2
star
50

slackbot-wordle

Python
2
star
51

udemy-video-utils

Shell
2
star
52

serverless-cvm

Based on awslabs/aws-iot-certificate-vending-machine; this deployment uses Serverless framework instead
JavaScript
2
star
53

ultimate-cat-watch

Building the Ultimate Cat Watch
C
2
star
54

aws-sumerian-magic-cube

This repo is a small end to end proof of concept on using AWS Sumerian with AWS IoT data
C++
2
star
55

device_farm_demo

Flutter CI/CD with Codemagic, Slyph & AWS Device Farm. Easy & Reliable integration testing on real hardware devices; learn how to ensure your Flutter apps run on all device types (iOS & Android)
Dart
2
star
56

aws-greengrass-s3-ingestor

The Greengrass S3 Ingestor component takes a stream of JSON messages from StreamManager and batches them into a gzip file. It uses a JSON Line (JSONL) format for the messages. The component enables efficient ingestion of data into S3 for further processing or storage.
Python
2
star
57

cat-a-log-code

JavaScript
2
star
58

gke-istio-bootstrap

A brief introduction into Istio and its role in modern production Kubernetes. We prepare for the future instalments of Practical Istio.
Python
2
star
59

aws-robomaker-docker

AWS RoboMaker is a development, deployment and simulation platform for ROS (Robot Operating System). We explore why Simulating robots on AWS is a big deal, and how you can do it too!
Python
2
star
60

kitty-catalog

AWS Serverless React App for fostering kitties
JavaScript
2
star
61

aws-ecr-continuous-scan

ECR Container Image Re-Scan
Go
1
star
62

fuelwatch

Fuelwatch Dashboard
Python
1
star
63

cdk-fah-covid19

Deploy Folding@Home on Amazon Fargate quick and easily with AWS CDK
TypeScript
1
star
64

gameHack

Interesting utilities and concepts to help understand game exploitation
C++
1
star
65

esp32-mqtt-publish

Example of authenticated MQTT publish over WiFi from the ESP32.
C
1
star
66

ros-devcontainer-codespaces

Shell
1
star
67

icu

Collection of tools, guides and examples that I use in my everyday for penetration testing
1
star
68

aws-iot-hackathon

Repo to house the information relating to my teams implementation for the AWS IoT App Hackathon
1
star
69

aws-ground-truth-cat-labels

A sample project for getting started with AWS SageMaker Ground Truth
1
star
70

powershell

A set of PowerShell resources I find to be useful
PowerShell
1
star
71

cloudy-toast

Toaster Stationary box for the masses... IN THE CLOUD
C++
1
star
72

garmin-connect-aws-dashboard

Python
1
star
73

aws-cdk-vscode-example

CDK Debugging in VSCode example
JavaScript
1
star
74

amplify-xray-demo

Sample repo for use with the Amplify AppSync - AWS X-Ray Integration blog post
JavaScript
1
star
75

aws-codecatalyst-gatsbyjs

Building a simple AWS CodeCatalyst workflow to deploy a GatsbyJS static site to s3. This guide is meant to facilitate how you might migrate an existing CI/CD pipeline to AWS CodeCatalyst
JavaScript
1
star
76

aws-greengrass-cfn

Learn how to deploy an AWS IoT Greengrass Core node onto a Raspberry Pi with AWS CloudFormation.
Shell
1
star
77

github-actions-aws-iot-build-status-light

Python
1
star
78

tribes-dashboard

Digital Tribes dashboard
HTML
1
star
79

gcp-asm3-demo

Going through the steps required to migrate and host Animal Shelter Manager (ASM3) on Google Cloud. Includes creating and managing a GKE Kubernetes instance and images stored on GCR
Shell
1
star
80

docker-things

Shell
1
star
81

roombaracers

Roomba Racers
CSS
1
star
82

tiled-topdown

A top down dungeon crawler written with the Phaser JavaScript/HTML5 platform and showing off simple level desgn with the Tiled map editor
JavaScript
1
star
83

dappster

รAppster is a decentralised application running on the Ethereum blockchain based off https://willdn.github.io/weicards/
CSS
1
star
84

gatsby-source-udemy

Gatsby source plugin for building websites using Udemy as a data source
JavaScript
1
star
85

automatingPython

Working repo for my reading through Al Sweigart's "Automate the boring stuff with Python"
Python
1
star
86

alexa-iot-traffic-lights

This is an example Alexa Skill that can be used to control a device over AWS IoT
JavaScript
1
star
87

f8-my-city-ui

JavaScript
1
star
88

pyCraft

Repository for some of the Minecraft Python code I write for Spigot server
Python
1
star
89

waanimals-fb-bot

Facebook Messenger chatbot to handle a variety of common interactions required for WA Animals admin
JavaScript
1
star
90

aws-credential-manager

GUI App for managing AWS Credentials - more useful as a demo of developing Tauri in a Devcontainer.
Rust
1
star
91

EarthARium_AR

Awake the scientist in young students by visualizing fascinating data about our home planet using augmented and virtual reality technology in the classroom.
C#
1
star
92

openai-finetune-shill

Using OpenAI fine-tuning we create a bot that can only reply to technical questions with answers including a particular technology stack
Python
1
star