Image Classification Using EANet in Python Keras

Image Classification Using EANet in Python Keras

Working on a computer vision project where I needed to classify hundreds of product images into different categories. As a developer, I always look for efficient deep learning architectures that can deliver strong accuracy without excessive computation. That’s when I came across EANet (External Attention Network), a lightweight yet powerful transformer-based model. In this tutorial, … Read more >>

Image Classification with ConvMixer in Keras

Image Classification with ConvMixer in Python

Working on an image classification project for a U.S.-based retail analytics company, I explored several deep learning architectures. I wanted something lightweight yet powerful enough to classify product images accurately. That’s when I came across ConvMixer, a fascinating model that combines the simplicity of CNNs with the design philosophy of Vision Transformers. In this tutorial, … Read more >>

Compact Convolutional Transformers in Python with Keras

Compact Convolutional Transformers in Python with Keras

I was working on a deep learning project where I needed a model that could combine the power of convolutional neural networks (CNNs) and transformers, but without consuming too much memory. That’s when I came across Compact Convolutional Transformers (CCT). These models are designed to be lightweight yet powerful, perfect for mobile and edge devices. … Read more >>

Pneumonia Classification Using TPU in Keras

Pneumonia Classification Using TPU in Keras

Recently, I worked on a deep learning project to classify chest X-ray images for pneumonia detection using Python and Keras. The challenge was to make the training process faster and more efficient, especially when dealing with thousands of medical images. That’s when I decided to use TPUs (Tensor Processing Units), powerful hardware accelerators that can … Read more >>

Check if a Variable Exists in Python (Without Getting It Wrong)

Python check if a variable exists: the Command Prompt showing that locals does not contain module globals

To check if a variable exists in Python, the idiomatic answer is to use it and catch the failure: The membership test looks tidier, and it has a trap. Inside a function, “x” in locals() returns False for a module-level variable that’s perfectly valid. The scope behaviour below is real output from Python 3.12.5. Checking … Read more >>

Python List Comprehension If Else: Where Each One Goes

Python list comprehension if else: the Command Prompt showing labels from a conditional expression and a shorter filtered list

In a Python list comprehension, if else goes before the for, and a bare if goes after it. Get that backwards and Python raises a SyntaxError. The first one labels every item. The second one throws items away. That single difference is what most of the questions about this are really about. I ran each … Read more >>

How I Find Duplicate Values in a Python Dictionary

does dictionary allow duplicates in python

While working on a data-cleaning project for a retail company in the USA, I faced an interesting challenge. I had a Python dictionary containing customer IDs as keys and their email addresses as values.Some customers accidentally used the same email address for multiple accounts, and I needed to find all duplicate values in that dictionary. … Read more >>

How to Unpack a List in Python

python unpack list

While working on a project that involved analyzing customer feedback data from different U.S. states, I had to unpack lists in Python multiple times. At first, it seemed simple, just extract values from a list and assign them to variables. But as my data became more complex, I realized how powerful Python’s list unpacking feature … Read more >>

Get an IP Address from a URL in Python

how to find the url of an ip address

Working on a Python web automation project, I needed to get the IP addresses of several websites dynamically. At first, I thought it would be as simple as sending a request and getting the IP, but I quickly realized that Python provides multiple ways to handle this task, each suitable for different use cases. In … Read more >>