This file contains hidden or 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
name: "wrn_151_v7" | |
layer { | |
name: "Data1" | |
type: "Data" | |
top: "Data1" | |
top: "Data2" | |
include { | |
phase: TRAIN | |
} | |
transform_param { |
This file contains hidden or 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
#in the name of Allah, the most compassionate the most merciful | |
#run this scrip under python2. python3 would work, but not prefectly. e.g. running this script and setting oversample to true in | |
#net.predict([input_image], oversample=True) will cause a crash. but it works just fine under python2. | |
import numpy as np | |
import os, sys, getopt | |
# Main path to your caffe installation | |
caffe_root = '/path/to/your/caffe/' | |
# Model prototxt file |
This file contains hidden or 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
# In the name of GOD the most compassionate the most merciful | |
# Last Updated : 4/9/2017 , updated the regex for the latest caffe (rc5) logs | |
# Originally developed by Yasse Souri | |
# Just added the search for current directory so that users dont have to use command prompts anymore! | |
# and also shows the top 4 accuracies achieved so far, and displaying the highest in the plot title | |
# Coded By: Seyyed Hossein Hasan Pour ([email protected]) | |
# -------How to Use --------------- | |
# 1.Just place your caffe's traning/test log file (with .log extension) next to this script | |
# and then run the script.If you have multiple logs placed next to the script, it will plot all of them | |
# you may also copy this script to your working directory, where you generate/keep your train/test logs |
This file contains hidden or 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
# Typical setup to include TensorFlow. | |
import tensorflow as tf | |
# Make a queue of file names including all the JPEG images files in the relative | |
# image directory. | |
filename_queue = tf.train.string_input_producer( | |
tf.train.match_filenames_once("./images/*.jpg")) | |
# Read an entire image file which is required since they're JPEGs, if the images | |
# are too large they could be split in advance to smaller files or use the Fixed |
This file contains hidden or 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
# In the name of GOD the most compassionate the most merciful | |
# Originally developed by Yasse Souri | |
# Just added the search for current directory so that users dont have to use command prompts anymore! | |
# and also shows the top 4 accuracies achieved so far, and displaying the highest in the plot title | |
# Added train/test plot! | |
# Coded By: Seyyed Hossein Hasan Pour ([email protected]) | |
# -------How to Use --------------- | |
# 0.First of all make sure your test layers name is 'accuracy' and the layer which reports your training accuracy is | |
# 'accuracy_training'. then you are good to go. if you are using different names for your test/train layers, make sure to edit | |
# the regex yourself. I might remove this limitation later, but at the moment this is a hacky edition to get my job done! |
This file contains hidden or 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
# In the name of GOD the most compassionate the most merciful | |
# Originally developed by Yasse Souri | |
# Just added the search for current directory so that users dont have to use command prompts anymore! | |
# and also shows the top 4 accuracies achieved so far, and displaying the highest in the plot title | |
# Coded By: Seyyed Hossein Hasan Pour ([email protected]) | |
# -------How to Use --------------- | |
# 0.First of all make sure your test layers name is 'accuracy' and the layer which reports your training accuracy is | |
# 'accuracy_training'. then you are good to go. if you are using different names for your test/train layers, make sure to edit | |
# the regex yourself. I might remove this limitation later, but at the moment this is a hacky edition to get my job done! | |
# so the code isnot polished! but is straight forward! |
This file contains hidden or 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
#in the name of GOD | |
#pylearn2 cifar10 convertor to lmdb | |
#by:Seyyed Hossein Hasanpour | |
#[email protected] | |
#2/14/2017 | |
import numpy as np | |
import cPickle | |
import lmdb | |
import caffe | |
from caffe.proto import caffe_pb2 |
This file contains hidden or 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
#in the name of God, the most compassionate the most merciful | |
#Seyyed Hossein Hasanpour | |
#[email protected] | |
#script for zeropadding and normalizing CIFAR10 dataset (can also be used for CIFAR100) | |
import math | |
import caffe | |
import lmdb | |
import numpy as np | |
from caffe.proto import caffe_pb2 | |
import cv2 |
This file contains hidden or 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
#In the name of God, the most compassionate the most merciful | |
import math | |
import numpy as np | |
#English: a simple handy snippet which I specifically wrote for calculating mean for a batch of images, | |
#in semi-vectorized and unvectorized fashion, along with the fully numpy example to test the output! | |
#Farsi: | |
#mohasebe mean batchi az tasavir be sorate vectorized, unvectorized and semi vectorized | |
#age version vectorized error kambod hafeze dad, behtare az semi vectorized estefade beshe | |
#chon unvectorized ya hamoon loop mamoli sooratesh kheyli kame. | |
#[email protected] |
This file contains hidden or 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
#In the name of God, the most compassionate the most merciful | |
#a non-vectorized and semi-vectorized implementation for calculating std for a batch of images. | |
#the semi-vectorized is the one, one should use, since its as fast as the numpy.std | |
#Seyyed Hossein Hasan pour | |
#[email protected] | |
#1/12/2017 | |
import math | |
#unvectorized version --really slow! | |
def calc_std_classic(a): | |
#sum all elements in each channel and divide by the number of elements |