Found 33676 Articles for Programming

How can Datatset.map be used in Tensorflow to create a dataset of image, label pairs?

AmitDiwan
Updated on 19-Feb-2021 17:46:59

227 Views

The (image, label) pair is created by converting a list of path components, and then encoding the label to an integer format. The ‘map’ method helps in creating a dataset that corresponds to the (image, label) pair.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and ... Read More

How can Tensorflow be used to create a pair using a file path for the flower dataset?

AmitDiwan
Updated on 19-Feb-2021 17:42:19

317 Views

To create an (image, label) pair, the path is first converted into list of path components. Then, the second to last value is added to the directory. Then, label is encoded into an integer format. The compressed string is converted to a tensor, and is then reshaped to the required size.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the ... Read More

How can Tensorflow be used with tf.data for finer control using Python?

AmitDiwan
Updated on 19-Feb-2021 17:40:17

199 Views

The ‘tf.Data’ helps in customizing the model building pipeline, by shuffling the data in the dataset so that all types of data get evenly distributed (if possible).Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, containing images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and requires zero configuration and free access to GPUs (Graphical Processing Units). ... Read More

How to encrypt and decrypt data in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:39:10

18K+ Views

IntroductionWhat is cryptography? Cryptography deals with the conversion of plain text into cipher text which is called encryption of data and cipher text back to plain text which is called decryption of data.We will be using the fernet module in the cryptography package to encrypt and decrypt data using Python. While using the fernet module, a unique key is generated without which you cannot read or manipulate the encrypted data.Now that you know what we will be dealing with, let’s get started.Getting StartedThe cryptography module does not come packaged with Python, which means you will have to install it using ... Read More

How to create powerpoint files using Python

S Vijay Balaji
Updated on 11-Feb-2021 06:36:51

16K+ Views

IntroductionWe’ve all had to make PowerPoint presentations at some point in our lives. Most often we’ve used Microsoft’s PowerPoint or Google Slides.But what if you don’t have membership or access to the internet? Or what if you just wanted to do it the “programmers” way?Well, worry not for Python’s got your back!In this article you’ll learn how to create a PowerPoint file and add some content to it with the help of Python. So let’s get started!Getting StartedThroughout this walkthrough, we’ll be using the python-pptx package. This package supports different python versions ranging from 2.6 to 3.6.So, make sure you ... Read More

How to control your mouse and keyboard using the pynput library in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:34:27

5K+ Views

IntroductionThe pynput library allows you to control and monitor/listen to your input devices such as they keyboard and mouse.The pynput.mouse allows you control and monitor the mouse, while the pynput.keyboard allows you to control and monitor the keyboard.In this article, we will be moving the cursor to a specific position, automate clicks, and simulate keystrokes from the keyboard.Without further ado, let’s get started.Getting StartedSince the pynput module does not come packaged with Python, you will have to manually download and install it using the pip package manager.To do this, launch your terminal and use the command below.pip install pynputOnce the ... Read More

How can Tensorflow be used with the flower dataset to compile and fit the model?

AmitDiwan
Updated on 19-Feb-2021 17:37:46

181 Views

The flower dataset can be compiled and fit to the model using the ‘compile’ and ‘fit’ methods respectively. To the ‘fit’ method, the training dataset as well as the validation dataset are passed as parameters. The number of epochs is also defined in the ‘fit’ method.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or ... Read More

How can Tensorflow configure the flower dataset for performance?

AmitDiwan
Updated on 19-Feb-2021 17:34:57

197 Views

The flower dataset would have given a certain percentage of accuracy when a model is created. If it is required to configure the model for performance, the buffer prefetch is used along with the Rescaling layer. This layer is applied using the Keras model, on the dataset, by making the rescaling layer a part of the Keras model.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.We are using the ... Read More

How to Build your own website using Django in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:32:31

8K+ Views

IntroductionDjango is a Python web framework that is both free and open source.Why Use Django?It’s very fast.Comes with a lot of pre-existing features like user authentication, site maps, RSS feeds.It is very secure and prevents a lot of security mistakes like SQL Injection, cross−site scripting, clickjacking etc.It is very scalable and thus can be used even when the network traffic is exceedingly high.Now that you know why we would be using Django to build our web application. Let us start setting up the ground work for it.Setting up an environmentWhile building our web application, we will be using various packages ... Read More

How can Tensorflow be used to standardize the flower dataset?

AmitDiwan
Updated on 19-Feb-2021 17:31:27

175 Views

Data standardization refers to the act of scaling the dataset to a level so that all the features can be represented using equivalent units. The rescaling layer is built using the ‘Rescaling’ method which is present in Keras module. The layer is applied to the entire dataset using the ‘map’ method.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the ... Read More

Advertisements