Menu

1 / 3

Build an offline visual defect search system with CLIP and VectorAI DB

DEV Community: computervision·Odewole Babatunde Samson·about 21 hours ago
#80E1lmXq
Reading 0:00
15s threshold

This article was originally published on the Actian blog .

In this tutorial, you'll build a search system that finds manufacturing defect photos by text description or by example image, filtered by part category and defect status, running entirely on local hardware. You'll need Python with uv , Docker, and about 605MB of disk space for the CLIP model weights.

OpenAI's CLIP turns images and text into comparable 512-dimensional vectors, and Actian VectorAI DB stores those vectors with metadata and searches them. After the one-time model download, nothing leaves the machine.

What the finished system does

A text search for "surface scratch on metal component", filtered to metal nuts, returned these top five results.

Score Category Defect Image

0.2814 metal_nut scratch 003.png

0.2691 metal_nut scratch 011.png

0.2607 metal_nut color 007.png

0.2588 metal_nut scratch 000.png

0.2470 metal_nut bent 014.png

Encoding the query took 18.4 ms and the search took 2.1 ms, for 20.5 ms in total.

A photo search with…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.