Skip to content
View baig97's full-sized avatar

Block or report baig97

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
baig97/README.md

Table of Contents

  1. Introduction

  2. Projects

    2.1. Realtime Face Beautification

    2.2. Hair Recolor

    2.3. Synthetic Face Generation and Editing using StyleGAN3 and InterFaceGAN

    2.4. Room Remodelling using Stable Diffusion

    2.5. Removing Captions from Videos/GIFS

    2.6. People Counting and Segmentation

    2.7. Crowd Proximity Detection

    2.8. Human Body Part Segmentation

    2.9. Custom Object Detection using YOLOv8

    2.10. Realtime Object Detection on Android/iOS

  3. Contact

1. Introduction

Meet Muhammad Abdullah, a passionate engineer with interest in mathematics, computer science and problem-solving. With his newfound knowledge and skillset in the field of AI and machine learning, he's looking towards solving real-world problems and helping businesses boost their productivity.

2. Projects

2.1. Realtime Face Beautification

Not ready for that online interview!? No problem, this project is what you need!

Using Mediapipe in combination with OpenCV, this project smartly applies facial filters to remove spots and apply lipstick, etc. while maintaining real and authentic look. The model is lightweight so it can give around 30FPS on CPU. The next phase of the project would be a mobile version of this project with more added features.

input.mp4
purple.mp4
red.mp4

2.2. Hair Recolor

Using semantic segmentation and custom computer vision algorithms, this project can recolor your hair to any shade you desire.

Hair recoloring to chestnut brown Hair recoloring to chestnut brown
Hair recoloring to chestnut brown Hair recoloring to chestnut brown
Figure 2.2.1: Hair recoloring to chestnut brown

2.3. Synthetic Face Generation and Editing using StyleGAN3 and InterFaceGAN

First, a few images of synthetic faces are generated by StyleGAN3.

Synthetic AI Generated Images

Figure 2.3.1: Synthetic faces generated using stylegan3

Then, these latent codes of these images are editing using InterFaceGAN directions to achieve desired effect. Real images can also be easily edited using various GAN techniques using e4e or pSp encoder. Have a look at some of the edits made using InterFaceGAN:

Attractive filter

Figure 2.3.2: Attractive filter

Feminine filter

Figure 2.3.3: Feminine filter

Smile filter

Figure 2.3.4: Smile filter

Black hair filter

Figure 2.3.5: Black hair filter

Smile + Attractive filter

Figure 2.3.6: Smile + Attractive filter

2.4. Room Remodelling using Stable Diffusion

An input image of a room is fed to Stable Diffusion model.

Picture of an old fashioned living room

Figure 2.4.1: Input image to be remodelled

Using depth2img for equi-depth output

Using depth2img from Stable Diffusion 2.1, the room is remodelled using a given prompt. The benefit of using depth2img is that the remodelled version of the room retains the walls and objects in the correct places. However, it might be undesirable when only partial remodelling is required (like changing furniture etc.)

Below are the results from two different prompts using depth2img.

Medieval style image output Medieval style image output
Medieval style image output Medieval style image output
Figure 2.4.2: Equi-depth outputs with prompt "minimalistic medieval bedroom"
Modern style image output Modern style image output
Modern style image output Modern style image output
Figure 2.4.3: Equi-depth outputs with prompt "minimalistic modern bedroom"

Using image inpainting with manual selection

When partial remodelling like furniture change is required, selective inpainting gives better results as demonstrated in this section. Below is the manual selection on the image (shown in black).

Manual selection applied on input image

Figure 2.4.4: Manual selection applied on input image Again, the results with the same two prompts are shown.
Medieval style image output Medieval style image output
Medieval style image output Medieval style image output
Figure 2.4.5: Manual selection with inpainting outputs with prompt "minimalistic medieval bedroom"
Modern style image output Modern style image output
Modern style image output Modern style image output
Figure 2.4.6: Manual selection with inpainting outputs with prompt "minimalistic modern bedroom"

The results show that selective inpainting can lead to better results when only partial remodelling is required. This is just a proof of concept. The current project can be upgraded to automatically detect and inpaint certain objects in the scene.

2.5. Removing Captions from Videos/GIFS

The project comes in form of a script which can take in a video/GIF as input and remove text overlay from it and inpaint the video in that region to generate a seamless output video/GIF.

Below are some sample input GIFs:

Sample GIF with caption Sample GIF with caption
Sample GIF with caption Sample GIF with caption
Figure 2.5.1: Input GIFs with captions

And these are the output GIFs generated after caption removal and inpainting:

Sample GIF with caption Sample GIF with caption
Sample GIF with caption Sample GIF with caption
Figure 2.5.2: Output GIFs without captions

2.6. People Counting and Segmentation

This is demonstration of a simple but common application of realtime object detection.

Detecting people in a crowd

Figure 2.6.1: People counting

Segmenting people in a crowd

Figure 2.6.2: People segmentation

2.7. Crowd Proximity Detection

The people counting application is enhanced via object promixity detection which works applying DPT by Intel on the image and combining the results with object detection output.

The image on the left shows a number over each box showing distance on an arbitary scale to the object. The image on the right shows the heatmap.

Crowd Detection with Proximity Sensing Crowd proximity heatmap
Figure 2.7.1: Crowd proximity detection with heatmap

The application can be used in assistive equipment for the visually impaired people.

2.8. Human Body Part Segmentation

This is a demonstration project that uses semantic segmentation to segment human body parts.

Human Body Part Segmentation Human Body Part Segmentation
Figure 2.8.1: Human Body Part Segmentation

2.9. Custom Object Detection using YOLOv8

This project demonstrates custom object detection via transfer learning using YOLOv8. Using transfer learning, YOLOv8 is trained on a moderate-sized dataset to detect potholes. The trained model gives great results.

Test ground-truth labels

Figure 2.9.1: Test ground truth boxes

Test predictions

Figure 2.9.2: Test predicted boxes

2.10. Realtime Object Detection on Android/iOS

This project takes any trained YOLO model and embeds it in a simple mobile application to perform realtime object detection from mobile devices.

Object detection on mobile app Object detection on mobile app
Figure 2.10.1: Realtime object detection on Android

3. Contact

If you want to discuss your ideas or projects with me, you can always connect with me on LinkedIn, Upwork, or Fiverr.

Popular repositories Loading

  1. baig97 baig97 Public

    Config files for my GitHub profile.

    2

  2. MediaPipeUnityPlugin MediaPipeUnityPlugin Public

    Forked from homuler/MediaPipeUnityPlugin

    Unity plugin to run MediaPipe

    C#

  3. baig97.github.io baig97.github.io Public

    HTML

  4. passenger-counter passenger-counter Public

    CSS

  5. hd_painter hd_painter Public

    Forked from Picsart-AI-Research/HD-Painter

    HD-Painter: High-Resolution and Prompt-Faithful Text-Guided Image Inpainting with Diffusion Models

    Python