Skip to content

gafar8281/Duplicate-Image-Detection-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖼️ Duplicate Image Detection API

A FastAPI-based web service that detects and returns the most visually similar image to a user-uploaded file by comparing it with previously stored images using feature matching techniques.

Features

  • Upload and store original images via REST API
  • Upload a new image to compare with stored ones
  • Detects visually similar images using:
    • ORB (Oriented FAST and Rotated BRIEF) for feature extraction
    • BFMatcher with Hamming distance for descriptor comparison
  • Returns the most similar image using a match scoring algorithm
  • Streaming response for efficient image delivery

How It Works

  1. Upload Original Image

    • http://127.0.0.1:8000/docs - detect-duplicate/v1/upload
    • Saves the image in the original_images directory
  2. Find Matching Image

    • http://127.0.0.1:8000/docs - detect-duplicate/v1/match
    • Accepts an uploaded image
    • Uses ORB to detect keypoints and descriptors
    • Compares descriptors with each stored image using BFMatcher
    • Calculates match score (lower score = more similar)
    • Returns the closest matching image as a response

Technologies Used

  • FastAPI – for building RESTful APIs
  • OpenCV – for image processing and feature detection
  • Python – core programming language
  • NumPy – for handling image buffers

Running the App

  • Install dependencies: pip install -r requirements.txt

  • Start the server: uvicorn script:app --reload

About

A FastAPI-based web service that detects and returns the most visually similar image to a user-uploaded file by comparing it with previously stored images using feature matching techniques.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages