Skip to content

Instantly share code, notes, and snippets.

@panmari
panmari / benchmarks.log
Created March 16, 2017 19:23
Benchmark for resize nearest neighbor on cpu
# Benchmarks for images with 6 channels.
# Full command line:
# bazel run -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda tensorflow/core/kernels:resize_benchmark_test_gpu -- --benchmarks=..
BEFORE
Benchmark Time(ns) Iterations
--------------------------------------------------------------------
BM_Resize_ResizeNearestNeighbor_cpu_10_499_499 50546710 100 295.6M items/s
BM_Resize_ResizeNearestNeighbor_gpu_10_499_499 9572830 100 1560.7M items/s
BM_Resize_ResizeBilinear_cpu_10_499_499 64680780 100 231.0M items/s
BM_Resize_ResizeBilinear_gpu_10_499_499 11350100 100 1316.3M items/s
@panmari
panmari / build.log
Last active December 17, 2015 20:18
/usr/bin/cmake -H/home/panmari/oiio -B/home/panmari/oiio/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/panmari/oiio/build/CMakeFiles /home/panmari/oiio/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/panmari/oiio/build'
make -f src/libutil/CMakeFiles/OpenImageIO_Util.dir/build.make src/libutil/CMakeFiles/OpenImageIO_Util.dir/depend
make[2]: Entering directory '/home/panmari/oiio/build'
cd /home/panmari/oiio/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/panmari/oiio /home/panmari/oiio/src/libutil /home/panmari/oiio/build /home/panmari/oiio/build/src/libutil /home/panmari/oiio/build/src/libutil/CMakeFiles/OpenImageIO_Util.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/panmari/oiio/build'
make -f src/libutil/CMakeFiles/OpenImageIO_Util.dir/build.make src/libutil/CMakeFiles/OpenImageIO_Util.dir/build
make[2]: Entering directory '/home/panmari/oiio/build'
@panmari
panmari / CMakeCache.txt
Last active December 17, 2015 19:54
oiio build on ubuntu 15.10
# This is the CMakeCache file.
# For build in directory: /home/panmari/oiio/build
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
import tensorflow as tf
import copy
epochs = 5
filename_seed = 4
capacity = 32
batch_size = 255
import string
import random
@panmari
panmari / conv_summary.py
Last active January 15, 2019 14:54
Tensorflow visualize convolutions
channels = 32
img_size = 128
W_conv1 = weight_variable([5, 5, 1, channels])
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1))
# Produces a tensor of size [-1, img_size, img_size, channels]
## Prepare for visualization
# Take only convolutions of first image, discard convolutions for other images.
V = tf.slice(h_conv1, (0, 0, 0, 0), (1, -1, -1, -1), name='slice_first_input')
# Using opencv for borderless cloning.
import cv2
import numpy as np
# Read images : src image will be cloned into dst
im_filename = "wolf.jpg"
im = cv2.imread(im_filename)
obj= cv2.flip(cv2.imread("hamster.jpg"), 1)
mask = cv2.flip(cv2.imread("hamster_mask.png"), 1)
mask = cv2.cvtColor(mask, cv2.COLOR_RGB2GRAY)
@panmari
panmari / Output_linux_gcc4.8.txt
Last active October 14, 2015 17:34
Testing performance of different ways to divide a 3d image by a 1d image channel wise. See also http://stackoverflow.com/questions/33098797/divide-every-channel-of-image-by-weight-image-in-opencv
OpenCV version: 3.0.0-dev
OpenCV VCS version: 3.0.0-556-g33f5ac5
Build type: release
Parallel framework: pthreads
CPU features: mmx sse sse2 sse3
OpenCL Platforms:
NVIDIA CUDA
dGPU: GeForce GTX TITAN (OpenCL 1.2 CUDA)
Current OpenCL device:
Type = dGPU
0.0015717675, 3.1868962E-4, 1.1206594, 0.5
-3.1435353E-4, 0.0015503819, 0.5213502, 0.5
5.2392254E-5, -2.58397E-4, 0.92690206, 3.0
0.0, 0.0, 0.0, 1.0
2.2.1 :001 > I18n.locale = :'pt-BR'
=> :"pt-BR"
2.2.1 :002 > I18n.l(Date.new, format: :very_long)
=> "Segunda, 01 de Janeiro de -4712, 00:00 h"
2.2.1 :003 > Date.new.strftime("%A, %d de %B de %Y, %H:%M h")
=> "Monday, 01 de January de -4712, 00:00 h"
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then manage sidekiq with:
# sudo start sidekiq index=0