Posts

Image preprocessing with Numpy and Scipy

http://prancer.physics.louisville.edu/astrowiki/index.php/Image_processing_with_Python_and_SciPy key takeways: Scipy: Imread, Imsave Plt: Imshow import numpy as np import matplotlib.pyplot as plt from scipy.misc import imsave # Create the image data image_data = np.zeros(512*512, dtype=np.float32).reshape(512,512) random_data = np.random.randn(512,512) image_data = image_data + 100.*random_data print 'Size: ', image_data.size print 'Shape: ', image_data.shape scaled_image_data = image_data / 255. # Save and display the image imsave('noise.png', scaled_image_data) plt.imshow(scaled_image_data, cmap='gray') plt.show() exit()   

The difference bewteen tf.shape() and tensor.get_shape()

https://stackoverflow.com/questions/36966316/how-to-get-the-dimensions-of-a-tensor-in-tensorflow-at-graph-construction-time I see most people confused about  tf.shape(tensor)  and  tensor.get_shape()  Let's make it clear: tf.shape tf.shape  is used for dynamic shape. If your tensor's shape is  changable , use it. An example: a input is an image with changable width and height, we want resize it to half of its size, then we can write something like: new_height = tf.shape(image)[0] / 2 tensor.get_shape tensor.get_shape  is used for fixed shapes, which means the tensor's  shape can be deduced  in the graph. Conclusion:  tf.shape  can be used almost anywhere, but  t.get_shape  only for shapes can be deduced from graph. def shape ( tensor ): s = tensor . get_shape () return tuple ([ s [ i ]. value for i in range ( 0 , len ( s ))]) Example: batch_size , num_feats = shape ( logits ) ...

Learning life while studying reinforcement learning algorithm

This algorithm has taught a lot about life. Brilliant algorithm indeed. The more parts of the algorithm I learn, the more I become intrigued. Looking forward to discovering more of it soon.

Faster R-CNN 논문 요약

Image
Faster R-CNN  논문명: Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks (2015) 저자: Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun 요약 1. Fast R-CNN의 경우 Regional proposal을 만드는데 너무 많은 시간이 소요됨 - Selective search의 경우 이미지 당 2초가 소요됨. 따라서 Selective Search + Fast R-CNN 조합으로는 real-time analysis가 불가능 함 2. Region Proposal Networks (RPNs)을 통해 이미지당 10ms라는 속도로 proposal 추출 가능하며, RPN + Fast R-CNN 조합을 통해 이미지당 10%의 속도 (대략 198ms)로 구현 가능 함 3. 특히, RPN + Fast R-CNN의 경우 정확도(Accuracy) 또 기존의 Selective Search + Fast R-CNN 보다 더욱 높게 나타남. 즉, 정확도와 속도 모두를 향상 시킬 수 있는 방법 임.  Object proposal    - Grouping super-pixels:  Selective search 등    - Sliding windows: EdgeBoxes 등    - Object proposal은 외부 별도의 모듈로써 도입 되었음  Object detection    -  R-CNN    -  Bounding box 생성:         OverFeat, MultiBox, DeepMask   Faster R-CNN    - ...

Tensorflow tutorial #1

#  Copyright 2016 The TensorFlow Authors. All Rights Reserved. # #  Licensed under the Apache License, Version 2.0 (the "License"); #  you may not use this file except in compliance with the License. #  You may obtain a copy of the License at # #   http://www.apache.org/licenses/LICENSE-2.0 # #  Unless required by applicable law or agreed to in writing, software #  distributed under the License is distributed on an "AS IS" BASIS, #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #  See the License for the specific language governing permissions and #  limitations under the License. """Convolutional Neural Network Estimator for MNIST, built with tf.layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.INFO) def cnn_model_fn(features, labels,...