Hussain Nasir Khan

A programmer, writer, and engineer. I have a deep interest in computer vision and artificial intelligence.

PIL image resize

How to resize an image in PIL (Pillow Python)

In this article, you’ll see how to resize an image in the PIL Python module. You can specify the width and height according to your requirement. In the following example, “cats.jpg” is the name of an image. Recommendation: Computer Vision: Models, Learning, and Inference Book

How to find the mode and type of an image in PIL

How to find the mode and type of an image in PIL (Pillow)

In this article, you’ll see how to find the mode and type of an image in the PIL module. You just have to change the name and location of the image. Output: RGB <class ‘PIL.JpegImagePlugin.JpegImageFile’> Recommendation: Computer Vision: Models, Learning, and Inference Book

PIL image size

How to find the PIL image size

In this article, you’ll see how to find the PIL image size in Python. You just have to use the following code. I highly recommend you get the “Computer Vision: Models, Learning, and Inference Book” to learn Computer Vision. Output: (1279, 711)

from PIL import Image

from PIL import Image

In this article, you’ll see how to import the PIL module in Python and why we import PIL instead of Pillow. You will also know why we use “from PIL import Image“. If you want to learn Computer Vision then I will highly recommend you to read This book. Import Pillow library The following code will import the …

from PIL import Image Read More »

Train Test Split Sklearn

Train Test Split Sklearn

In this article, you’ll see the implementation of a train-test split in Python using Sklearn. If you want to learn machine learning, I recommend you get the “Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow” book. In this example, we will use the iris dataset. There are 150 rows and 5 columns in this dataset. …

Train Test Split Sklearn Read More »

No Module Named helpers

No Module Named helpers

You can resolve the error “No module named helpers” with the following code. This error arises when the helpers library is not installed. I highly recommend you get the “Python Crash Course Book” to learn Python.

No Module Named hvac

No Module Named hvac

You can resolve the error “No module named hvac” with the following code. This error arises when the hvac is not installed. I highly recommend you get the “Python Crash Course Book” to learn Python.

No Module Named html.parser

No Module Named html.parser

You can resolve the error “No module named html.parser” with the following code. This error arises when the html.parser is not installed. I highly recommend you get the “Python Crash Course Book” to learn Python.