Skip to content

Instantly share code, notes, and snippets.

@ProGamerGov
ProGamerGov / linear-color-transfer.py
Created February 16, 2017 17:41
This script performs the linear color transfer step that the Scale Control feature in leongatys/NeuralImageSynthesis performs.
#This script performs the linear color transfer step that
#leongatys/NeuralImageSynthesis' Scale Control code performs.
#https://github.com/leongatys/NeuralImageSynthesis/blob/master/ExampleNotebooks/ScaleControl.ipynb
import scipy
import h5py
import skimage
import os
from skimage import io,transform,img_as_float
from skimage.io import imread,imsave
from collections import OrderedDict
require 'torch'
require 'nn'
require 'image'
require 'optim'
require 'loadcaffe'
local cmd = torch.CmdLine()
@ProGamerGov
ProGamerGov / neural_style_csv.lua
Last active January 21, 2017 20:29
A version of neural_style.lua that outputs loss values to the terminal in a csv friendly format
require 'torch'
require 'nn'
require 'image'
require 'optim'
require 'loadcaffe'
local cmd = torch.CmdLine()
@ProGamerGov
ProGamerGov / tensor_test.py
Last active January 5, 2017 23:38
Tests whether or not Tensorflow sees your GPU or CPU
import tensorflow as tf
# Creates a graph.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print sess.run(c)
name: "VGG16_SOD_finetune"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
Datasts:
https://github.com/ChristosChristofidis/awesome-deep-learning#datasets
Style Transfer Projects:
https://github.com/jcjohnson/neural-style/wiki/Similar-to-Neural-Style
@ProGamerGov
ProGamerGov / train_val_nsfw.prototxt
Last active October 14, 2016 06:14
A train_val for the Yahoo nsfw model
name: "Resnet_50_1by2"
force_backward: true
# Note - replace below layer with your data layer
layer {
name: "data"
type: "MemoryData"
top: "data"
top: "label"
transform_param {
crop_size: 224
`simon1.tar.gz` 586 images (only colored) | 184 MB
`simon2.tar.gz` 725 images (including uncolored sketches and photos of sketches) | 282 MB
None of the images have been resized or cropped yet.
A txt file called "filelist.txt" lists every image's name,
so all you need to do is add the category value and the paths
for use in Caffe when making your train.txt and val.txt files.
`simon1.tar.gz` 586 images (only colored) | 184 MB
`simon2.tar.gz` 725 images (including uncolored sketches and photos of sketches) | 282 MB
None of the images have been resized or cropped yet. A txt file called "filelist.txt" lists every image's name, so all you need to do is add the category and path for use in Caffe.
$ ./build/tools/caffe time --model=models/NIN/train_val.prototxt
Check failed: status.ok() Failed to open leveldb cifar-train-leveldb
Invalid argument: cifar-train-leveldb: does not exist (create_if_missing is false)
*** Check failure stack trace: ***