Skip to content

Instantly share code, notes, and snippets.

View kkk324's full-sized avatar
🌴
I may be slow to respond.

kkk324

🌴
I may be slow to respond.
View GitHub Profile
from matplotlib import pyplot as plt
import cv2
img = cv2.imread('/Users/mustafa/test.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.imshow(gray)
plt.title('my picture')
plt.show()
@kkk324
kkk324 / load_jpeg_with_tensorflow.py
Created November 8, 2017 06:01 — forked from eerwitt/load_jpeg_with_tensorflow.py
Example loading multiple JPEG files with TensorFlow and make them available as Tensors with the shape [[R, G, B], ... ].
# 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
@kkk324
kkk324 / atrous_test.py
Created November 5, 2017 20:03 — forked from ahundt/atrous_test.py
tf tensorflow atrous convolution aka dilated convolution test
import tensorflow as tf
import numpy as np
dim = 256
kernel_dim = 3
dilation_rate = np.array([2, 2])
input_img_np = np.random.random((1, dim, dim, 1)).astype(np.float32)
kernel = np.random.random((kernel_dim,kernel_dim,1,1)).astype(np.float32)
with tf.Session() as sess: