Skip to content

Instantly share code, notes, and snippets.

@notune
notune / video_heatmap.py
Created January 10, 2024 02:10
Simple Python script to create a heatmap from a video file
import sys
import cv2
import numpy as np
def preprocess_frame(frame):
# Convert to grayscale and apply Gaussian blur
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(gray, (21, 21), 0)
return blurred
@notune
notune / imagen.py
Last active October 12, 2023 10:42
Use Google Imagen
import re
import requests
import json
import base64
# SET THESE VALUES
PROJECT_ID = "<REPLACE_WITH_YOUR_PROJECT_ID_HERE>"
TOKEN = "<REPLACE_WITH_YOUR_TOKEN_HERE>"
PROMPT = "futuristic portrait of mona lisa, canon eos 5d mark iii, 50mm f/1.4 usm lens"