DEV Community

Cover image for DeepFace Based Image Similarity / Resemblance Sorter Gradio APP - Can Be Used to Batch Sort AI images - Works on Real Images Too
Furkan Gözükara
Furkan Gözükara

Posted on

1 1 1 1 1

DeepFace Based Image Similarity / Resemblance Sorter Gradio APP - Can Be Used to Batch Sort AI images - Works on Real Images Too

Installers

-

Installer zip file shared here : https://www.patreon.com/posts/121335747

-

This APP is based on DeepFace

https://github.com/serengil/deepface

It is fully multi-threaded and higher batch size increase your processing speed

Make sure to have accurately installed CUDA and cuDNN for TensorFlow library to use your GPU or else it will be ultra slow

It uses minimal amount of VRAM so should work on every GPU pretty much

What this APP does is that, it takes source images folder, target images folder and optionally extracted faces folder

Then it calculates every target image similarity / distance to the source images individually (if multiple source images used it averages them) and at the end sort all target images according to their similarity / distance

When you use more than 1 image in source images folder, it will sort according to the average of the source images but be careful it will increase processing time linearly since each image compared with each target image

If few images gives error at first run, you can run again and it usually fixes error occurred images - i am still not sure why this happens - probably related to DeepFace library

This app can be extremely useful to sort AI generated images according to the original training images to get the best ones comparatively

The images in target folder will be renamed as the followings

Image_Similarity_Rank - Image_Similarity_Score - Older File Name

e.g. image_rock.png will become 33 - 0.55 - image_rock.png

33 is similarity rank, 0.55 is its distance (lesser is more similar)

Following DeepFace models supported but I didn't test them except Facenet512 which is best

Image description

Image description

Image description

Image description

Image description

Image description

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 🕒

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more