Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Extract jpgs from videos inside categorized folders for Inception training
for d in */ ;
do
for i in $d/*.mp4;
do
mkdir $d/$d;
ffmpeg -i "$i" -r 10 "${d}/${d}/`basename "${i}"-%04d`.jpg";
done;
done
@rchgit
rchgit / Sample_training_img_classification.sh
Created November 28, 2016 06:09
Sample retraining script for Inception network
python ~/tensorflow/tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=bottlenecks_sg \
--model_dir=inception \
--output_graph=bottlenecks_sg/retrained_graph.pb \
--output_labels=bottlenecks_sg/retrained_labels.txt \
--image_dir multimodal_jpg \
--summaries_dir summaries_sg
@rchgit
rchgit / raspi_h264tomp4.sh
Created November 30, 2016 18:07
Batch converts RasPi H264 raw video to MP4
for i in *.h264;
do
MP4Box -add $i `basename "${i}"`.mp4;
done;
def load_data(data_dir, labels):
X_signals_train = np.zeros((1,9))
X_signals_test = np.zeros((1,9))
y_train = np.zeros([1,1])
y_test = np.zeros([1,1])
for label in labels:
for root, dirs, files in os.walk(data_dir + "/" + label):
for filename in files:
signal = genfromtxt(data_dir + "/" + label + "/" + filename, delimiter=',')
#print (signal)
import csv
import glob
file_list = glob.glob("*/*.csv")
print(file_list)
for file_name in file_list:
with open(file_name, "r") as source:
rdr = csv.reader(source)
with open(file_name+"-lstm", "w") as result:
@rchgit
rchgit / gitlab-ipython-notebook.md
Created December 21, 2016 12:44 — forked from martijnvermaat/gitlab-ipython-notebook.md
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).

import imageio
import os
import numpy as np
import tensorflow as tf
import tflearn
import pickle
from collections import deque
from sklearn.model_selection import train_test_split
from tflearn.data_utils import to_categorical
import tensorflow as tf
import tflearn
import os
import numpy as np
import time
from collections import deque
from sklearn.model_selection import train_test_split
from tflearn.data_utils import to_categorical
@rchgit
rchgit / Contract Killer 3.md
Created April 26, 2017 03:35
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.