Skip to content

Commit 1277386

Browse files
authored
Update README.md
1 parent 211441c commit 1277386

File tree

1 file changed

+64
-14
lines changed

1 file changed

+64
-14
lines changed

README.md

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,77 @@
1-
# Brute Force Image Search
21

3-
This project is a real-time brute force image search application that searches for related images of objects captured by a camera.
4-
It leverages computer vision techniques to find matching images from a predefined dataset.
2+
3+
# Object Matching with CLIP & OpenCV
4+
5+
## Overview
6+
7+
This project implements a simple object matching system using OpenCV for webcam capture and OpenAI's CLIP model for image similarity detection. The goal is to open the camera feed, detect when an object from a small dataset is presented, and display the most similar image side-by-side in real time.
8+
9+
---
510

611
## Features
712

8-
- Real-time object recognition using computer vision.
9-
- Brute force search to find similar images in a dataset.
10-
- Integration with camera feed for live searches.
11-
- Simple and easy-to-use.
13+
* Real-time webcam preview
14+
* Efficient object matching using CLIP’s pretrained image embeddings
15+
* Displays the closest matching dataset image next to the live camera feed when a match is found
16+
* Lightweight solution tailored for small datasets (e.g., 5 images)
17+
* Threshold tuning for balancing accuracy and detection sensitivity
18+
19+
---
20+
21+
## Technologies Used
22+
23+
| Technology | Purpose |
24+
| ---------------- | -------------------------------------------------------------------------------------------------------------- |
25+
| **OpenCV** | Capture video from the webcam, process frames, and display results. |
26+
| **OpenAI CLIP** | Compute semantic embeddings for images and measure similarity between the live camera feed and dataset images. |
27+
| **PyTorch** | Deep learning framework to run the CLIP model efficiently on CPU or GPU. |
28+
| **PIL (Pillow)** | Image preprocessing before feeding images to CLIP. |
29+
| **NumPy** | Handle array operations for image processing and similarity computations. |
30+
31+
---
1232

13-
## Getting Started
33+
## Why These Technologies?
1434

15-
To get started with the project, follow these steps:
35+
* **OpenCV** is the de facto standard for real-time video and image processing in Python, providing easy access to camera streams and visualization tools.
36+
* **CLIP** (Contrastive Language–Image Pretraining) is a state-of-the-art model that produces rich, semantic image embeddings without requiring additional training. This makes it ideal for small projects where retraining large models isn’t feasible.
37+
* Using **CLIP** allows comparing visual similarity at a semantic level rather than just pixel matching or local features, improving robustness to lighting, angle, and minor variations.
38+
* **PyTorch** provides a flexible backend for running CLIP efficiently, taking advantage of GPUs if available, but also running on CPU for smaller-scale projects.
39+
* **PIL** is used to preprocess images to the format CLIP expects.
40+
* **NumPy** enables efficient numerical operations needed for similarity scoring.
1641

17-
1. **Prerequisites**: Make sure you have the required libraries and dependencies installed.
42+
---
1843

19-
2. **Configuration**: Configure the project settings and dataset for image search.
44+
## Setup and Usage
2045

21-
3. **Run the Application**: Execute the application to start live image searching.
46+
### Requirements
2247

23-
ALL ABOVE POINTS ARE SO IMPORTANT TO EXECUTE,PLEASE KEEP A NOTE OF THEM !!
24-
ALL THE BEST !
48+
* Python 3.7+
49+
* pip packages: `opencv-python`, `torch`, `openai-clip`, `numpy`, `Pillow`
50+
51+
### Installation
2552

2653
```bash
54+
pip install opencv-python torch openai-clip numpy Pillow
55+
```
56+
57+
### Running the Program
58+
59+
1. Place your dataset images in a folder (e.g., `testimg/`).
60+
2. Run the main script:
61+
62+
```bash
63+
python BFSearch.py
64+
```
65+
3. The camera window will open.
66+
4. Place an object from your dataset in front of the camera.
67+
5. When a matching object is detected, its image will be displayed side-by-side with the camera feed.
68+
69+
---
70+
71+
## Limitations & Future Work
72+
73+
* The matching threshold might require tuning depending on lighting and dataset quality.
74+
* Works best with small datasets; larger datasets may require optimization.
75+
* Future improvements may include more advanced object detection or real-time bounding boxes.
76+
* Integration with GUI frameworks for better user interaction.
2777

0 commit comments

Comments
 (0)