Skip to main content

Posts

Showing posts from 2018

How to make a simple Optical Character Recognition in 12 lines of code.

Just to motivate you! Optical character recognition is the recognition of typed, handwritten or printed text and converting them into text. OCR can be used to automate various task involving humans, like in banking, OCR is being used to process checks without human involvement, generating content of documents from their scanned images, it can also be helpful for visually impaired people, etc. For this OCR we'll be using Microsoft's Computer Vision API. We'll do a post request for making an API call in python. and in response, we'll get output in JSON format. To get started you are required to have a Microsoft account, and after that, you can get a free subscription to computer vision API for 30 days. You have to acquire your secret subscription key which looks similar to this 98f714r6vb2e193018b28fg1u9b3b0d7e7. #Defining base url for API call. base_url = "https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/" ocr_url = base_url...

Operating System: Threads and Concurrency

Threads Definition: A Thread also called lightweight process, is basic CPU utilization; it compromises a thread ID, a program counter, a register set, and a stack. A thread is an entity within a process that can be scheduled for execution. If we want a process to be able to execute on multiple CPUs at a time, to take advantage of the multi-core systems, the process must have several execution-context called threads. A thread is an active entity which executes a part of a process. Multiple threads execute simultaneously with each other which results in the execution of a single whole process. As several threads of a process execute at the same time they are required to maintain coordination with each other. Coordination between the threads is required in order to share system resources like I/O devices, memory, and of course CPU. The threads of a process are the part of the same virtual address space (i.e. they share all virtual to physical mapping), they share all the data, cod...

Operating System: Process and Process Management

Process In simple words, a process is an instance of an executing application. An application is a file containing a list of instructions stored in the disk (often called an executable file), in flash memory, maybe in the cloud but it's not executing, it's a static entity. When an application is launched it is loaded into the memory and it becomes a process, so it is an active entity with a program counter specifying the next instruction to execute and a set of associated resources. If the same program is launched more than once than multiple processes will be created executing the same program but will be having a very different state. A process encapsulates all the data for running application, this includes the text , the code of the program, a data section, which contains global variables and data which are available when the process is first initialized. As text and the data are available when the process is first initialized they are called static s...

Operating System: Introduction

What is an Operating System? An operating system is a layer of system software between applications and hardware that abstracts (i.e. simplify what hardware actually looks like) and arbitrates (ie. manage, overseas and control the hardware use). Functions of Operating System Hides hardware complexity: OS hides hardware complexity for applications as well as for application developers. Application developers, for example, don't need to worry about disk sectors or block when saving a file to the disk. In fact mechanism for reading/writing a file on a hard drive is different from reading/writing the file on a USB drive or SSD which is all handled by OS. Similarly, OS abstracts the network resource and provide a higher level abstraction called Socket and provide some services to send and receive packets from that socket. Resource Management: OS also manages the resources used by the application. It decides how many and which one of the above resources will b...

Convolution Neural Network (CNN): Introduction

Convolution Neural Network:  When it comes to Machine Learning, Artificial Neural Networks perform really well. Artificial Neural Networks are used in various classification task like images, audios, words, etc. Different types of Neural Networks are used for different purposes, for example for predicting the sequence of words we use Recurrent Neural Networks, more precisely a LSTM, similarly for image classification we use Convolution Neural Network. In this blog, we are going to build basic building block for CNN. Before diving into the Convolution Neural Network, let us first revisit some concepts of Basic Neural Network. In a regular Neural Network there are three types of layers: Input Layers:  It’s the layer in which we give input to our model. The number of neurons in this layer is equal to total number of features in our dataset (number of pixels incase of an image). Hidden Layer:  The input from Input layer is then fed into the hidden layer. Ther...