This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the "features" portion of VGG19 | |
# The classifier portion is not needed for style transfer | |
vgg = models.vgg19(pretrained=True).features | |
# Freeze all VGG parameters | |
# Since only activations are measured for each conv layer | |
# Network weights aren't modified | |
for param in vgg.parameters(): | |
param.requires_grad_(False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
import numpy as np | |
import cv2 | |
def predict_transform(prediction, inp_dim, anchors, num_classes, CUDA = True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DQN(nn.Module): | |
def __init__(self, input_shape, n_actions): | |
super(DQN, self).__init__() | |
self.conv = nn.Sequential( | |
nn.Conv2d(input_shape[0], 32, kernel_size=8, stride=4), | |
nn.ReLU(), | |
nn.Conv2d(32, 64, kernel_size=4, stride=2), | |
nn.ReLU(), | |
nn.Conv2d(64, 64, kernel_size=3, stride=1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.colab.output import eval_js | |
from base64 import b64decode | |
VIDEO_HTML = """ | |
<video autoplay | |
width=800 height=600></video> | |
<script> | |
var video = document.querySelector('video') | |
navigator.mediaDevices.getUserMedia({ video: true }) | |
.then(stream=> video.srcObject = stream) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Base length subtraction has to subtract file extension then re-add after | |
Dir | Rename-Item -NewName {$_.name.substring(3,$_.BaseName.length-4) + '.png'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"profiles": [ | |
{ | |
"name": "Default profile", | |
"selected": true, | |
"complex_modifications": { | |
"rules": [ | |
{ | |
"description": "A Modern Space Cadet (Steve Losh)", | |
"manipulators": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Store a backup ppm after rendering every 100 rows | |
if (j % 100 == 0) { | |
ofs.close(); | |
temp_filename = "./out_" + std::to_string(ny-j) + ".ppm"; | |
std::ifstream src("out.ppm", std::ios::binary); | |
std::ofstream dst(temp_filename, std::ios::binary); | |
dst << src.rdbuf(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.liamhinzman.arbtt</string> | |
<key>Program</key> | |
<string>/Users/liamhinzman/screenshot.sh</string> | |
<key>RunAtLoad</key> | |
<true/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
camera_name = 'ubercam' | |
cameras_group = 'Cameras' | |
overscan_value = 1.2 | |
gate_color = (0.0, 0.0, 0.0) | |
gate_opacity = 1.0 | |
if cmds.objExists(camera_name): |