Skip to content

Instantly share code, notes, and snippets.

View Sitin's full-sized avatar

Mykhailo Ziatin Sitin

  • Computational Arts Center
  • Kiev, Ukraine
View GitHub Profile
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
diff --git a/modules/highgui/src/cap_qtkit.mm b/modules/highgui/src/cap_qtkit.mm
index 207f01b..4f7b188 100644
--- a/modules/highgui/src/cap_qtkit.mm
+++ b/modules/highgui/src/cap_qtkit.mm
@@ -277,8 +277,11 @@ bool CvCaptureCAM::grabFrame(double timeOut) {
double sleepTime = 0.005;
double total = 0;
- while (![capture updateImage] && (total += sleepTime)<=timeOut)
- usleep((int)(sleepTime*1000));
@Sitin
Sitin / console.log
Created April 10, 2016 22:07
libnd4j: lots of compilation errors
/usr/local/cuda/include/math_functions.h(9406): error: __lazy_enable_if is not a template
/Users/sitin/Documents/Workspace/dlf4/libnd4j/include/shape.h(74): error: duplicate specifier in declaration
/Users/sitin/Documents/Workspace/dlf4/libnd4j/include/shape.h(82): error: duplicate specifier in declaration
/Users/sitin/Documents/Workspace/dlf4/libnd4j/include/shape.h(1489): error: duplicate specifier in declaration
/Users/sitin/Documents/Workspace/dlf4/libnd4j/include/shape.h(2625): warning: a __host__ function("shape::stride") redeclared with __host__ __device__, hence treated as a __host__ __device__ function
@Sitin
Sitin / nvcc --verbose
Last active April 11, 2016 08:31
libnd4j compilation error: __lazy_enable_if is not a template
$ /usr/local/cuda/bin/nvcc --verbose /Users/sitin/Documents/Workspace/dlf4/libnd4j/blas/cuda/NativeOps.cu -c -o /Users/sitin/Documents/Workspace/dlf4/libnd4j/blas/CMakeFiles/nd4j.dir/cuda/./nd4j_generated_NativeOps.cu.o -m64 --std c++11 -D__CUDABLAS__=true -Dnd4j_EXPORTS -Xcompiler ,\"-Wall\",\"-fopenmp\",\"-fassociative-math\",\"-funsafe-math-optimizations\",\"-march=native\",\"-O3\",\"-ffast-math\",\"-ftree-vectorize\",\"-msse2\",\"-fPIC\",\"-g\",\"-O0\" -DVERBOSE -G -g -lcublas -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -DNVCC -I/usr/local/cuda/include -I/Users/sitin/Documents/Workspace/dlf4/libnd4j/include -I/Users/sitin/Documents/Workspace/dlf4/libnd4j/blas/../include -I/usr/local/cuda/include
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/usr/local/cuda/bin
#$ _THERE_=/usr/local/cuda/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_
@Sitin
Sitin / build.log
Created April 19, 2016 22:47
libnd4j+cuda build fails
$ ./buildnativeoperations.sh blas cuda release
eval cmake
RUNNING OSX CLANG
Running blas
./buildnativeoperations.sh: line 103: e: command not found
-- The C compiler identification is AppleClang 7.3.0.7030029
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
@Sitin
Sitin / error.log
Created April 20, 2016 00:02
deeplearning4j can't find libnd4j
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load the native library.
Error while loading native library "libnd4j-apple-x86_64" with base name "libnd4j"
Operating system name: Mac OS X
Architecture : x86_64
Architecture bit size: 64
Stack trace from the attempt to load the library as a resource:
java.lang.NullPointerException: No resource found with name '/lib/liblibnd4j-apple-x86_64.dylib'
at org.nd4j.linalg.cpu.nativecpu.util.LibUtils.loadLibraryResource(LibUtils.java:149)
at org.nd4j.linalg.cpu.nativecpu.util.LibUtils.loadLibrary(LibUtils.java:83)
at org.nd4j.linalg.cpu.nativecpu.ops.NativeOps.<clinit>(NativeOps.java:17)
@Sitin
Sitin / install.sh
Last active January 19, 2017 00:27
DCGAN on Tensorflow for simplified Oxford flowers dataset
git clone https://github.com/artistic-ai/DCGAN-tensorflow.git
cd DCGAN-tensorflow
python download.py 17flowers_simplified
python main.py --dataset 17flowers_simplified --input_height=128 --is_crop True --input_fname_pattern "*.png" --is_train --samples_rate=10 --checkpoint_rate=100 --epoch 50
@Sitin
Sitin / install.sh
Created January 21, 2017 14:57
Setup multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
git clone https://github.com/artistic-ai/char-rnn-tensorflow.git
cd char-rnn-tensorflow
# Load all datasets
./main.py --datasets-all
# Train default model for Sei Shōnagon's pillowcase (RU)
./main.py --train pillowcase-ru
# Get sample for trained model
$ UPLOADCARE_PUBLIC_KEY=foo UPLOADCARE_PRIVATE_KEY=bar bundle exec rake db:migrate
I, [2017-03-07T14:32:43.625090 #6360] INFO -- sentry: ** [Raven] Raven 1.2.0 configured not to send errors.
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block in <class:Railtie> at /Users/sitin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/react-rails-1.8.0/lib/react/rails/railtie.rb:110)
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
@Sitin
Sitin / install.sh
Last active February 1, 2022 19:35
Install Autodesk's Python FBX SDK for Homebrew Python 2.7 & 3.x
function link_fbx_sdk() {
INTERPRETER=$1
SITE_PACKAGES=`$INTERPRETER -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
PYTHON_LIB="${2}"
echo "[Installing] '$PYTHON_LIB' to '$SITE_PACKAGES'"
pushd $SITE_PACKAGES
for file in "${PYTHON_LIB}"/*
do